Detect button clicked - DOTNET

This is a discussion on Detect button clicked - DOTNET ; Hi, I would like to create an eventhandles that handles several different buttons. How can I detect which button was clicked on ? I know it something with the sender ... something like Private sub Button_Click(ByVal sender as object, ByVal ...

+ Reply to Thread
Results 1 to 3 of 3

Detect button clicked

  1. Default Detect button clicked


    Hi,

    I would like to create an eventhandles that handles several different
    buttons.

    How can I detect which button was clicked on ?
    I know it something with the sender ...

    something like

    Private sub Button_Click(ByVal sender as object, ByVal e as
    system.EventArgs)

    select case e

    end select

    End sub





    Thank



    John





  2. Default Re: Detect button clicked


    Hi,

    I found it myself




  3. Default Re: Detect button clicked

    Here's the solution



    <asp:Button ID="btnFirst" runat="server" text="<<" Width="25px"
    CommandName="First" />

    <asp:Button ID="btnPrevious" runat="server" text="<" Width="25px"
    CommandName="Prev" />

    <asp:Button ID="btnNext" runat="server" text=">" Width="25px" CommandName="Next"
    />

    <asp:Button ID="btnLast" runat="server" text=">>" Width="25px" CommandName="Last"
    />



    Protected Sub NavigationButtons_Command(ByVal sender as object, _

    ByVal e As
    Systems.Web.UI.Webcontroles.CommandEventArgs) _

    Handles btnFirst.Command,
    btnPrevious.Command, _

    btnNext.Command, btnLast.command



    Select case e.commandName

    case "First"

    ....

    case "Prev"

    ....

    End select

    End sub









+ Reply to Thread

Similar Threads

  1. System.ObjectDisposed Exception when Button is clicked
    By Application Development in forum CSharp
    Replies: 1
    Last Post: 10-30-2007, 05:09 PM
  2. Apply CSS style for table row if radio button is clicked
    By Application Development in forum Javascript
    Replies: 2
    Last Post: 06-07-2007, 02:30 PM
  3. Trying to run JavaScript when a radio button is clicked
    By Application Development in forum Adobe Acrobat
    Replies: 4
    Last Post: 01-16-2007, 04:25 PM
  4. Prompt message when button is clicked in FDF Toolkit
    By Application Development in forum Adobe Acrobat
    Replies: 0
    Last Post: 08-01-2006, 03:52 PM
  5. how to open a new browser window when clicked on a button control?
    By Application Development in forum Javascript
    Replies: 2
    Last Post: 02-09-2005, 10:05 AM