more about link buttons

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Sep 9, 2005.

  1. hey all,

    i have 4 link buttons on my page. could i just i have 1 handler for all
    these buttons? if so, how can i let the handler which button got clicked?

    thanks,
    rodchar
    =?Utf-8?B?cm9kY2hhcg==?=, Sep 9, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?cm9kY2hhcg==?=

    Lucas Tam Guest

    "=?Utf-8?B?cm9kY2hhcg==?=" <> wrote in
    news::

    > hey all,
    >
    > i have 4 link buttons on my page. could i just i have 1 handler for all
    > these buttons? if so, how can i let the handler which button got clicked?



    Yes you can.

    You can use the CommandArguement or CommandName properties of the
    linkbutton to specify which button was clicked.



    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.

    Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
    Lucas Tam, Sep 9, 2005
    #2
    1. Advertising

  3. Rodchar,

    In the handler cast the sender to a link button and then check it's client
    ID.

    In vb it looks like:

    Dim LinkButtonSent As LinkButton = CType(Sender, LinkButton)

    Select Case LinkButton.ID
    Case "LinkButton1"
    '---Do something here.
    Case "LinkButton2"
    '---Do something here.
    End Select

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "rodchar" <> wrote in message
    news:...
    > hey all,
    >
    > i have 4 link buttons on my page. could i just i have 1 handler for all
    > these buttons? if so, how can i let the handler which button got clicked?
    >
    > thanks,
    > rodchar
    S. Justin Gengo, Sep 9, 2005
    #3
  4. you guys are great. thanks for the help.

    "S. Justin Gengo" wrote:

    > Rodchar,
    >
    > In the handler cast the sender to a link button and then check it's client
    > ID.
    >
    > In vb it looks like:
    >
    > Dim LinkButtonSent As LinkButton = CType(Sender, LinkButton)
    >
    > Select Case LinkButton.ID
    > Case "LinkButton1"
    > '---Do something here.
    > Case "LinkButton2"
    > '---Do something here.
    > End Select
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer / Programmer
    >
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzsche
    > "rodchar" <> wrote in message
    > news:...
    > > hey all,
    > >
    > > i have 4 link buttons on my page. could i just i have 1 handler for all
    > > these buttons? if so, how can i let the handler which button got clicked?
    > >
    > > thanks,
    > > rodchar

    >
    >
    >
    =?Utf-8?B?cm9kY2hhcg==?=, Sep 9, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    800
    Kevin Spencer
    May 17, 2005
  2. Roger
    Replies:
    1
    Views:
    616
    GreggTB
    May 20, 2005
  3. =?Utf-8?B?QmVu?=

    Image Buttons/Buttons not responding

    =?Utf-8?B?QmVu?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    435
    Teemu Keiski
    Jul 6, 2005
  4. Michael
    Replies:
    4
    Views:
    400
    Matt Hammond
    Jun 26, 2006
  5. Robert Klemme

    With a Ruby Yell: more, more more!

    Robert Klemme, Sep 28, 2005, in forum: Ruby
    Replies:
    5
    Views:
    206
    Jeff Wood
    Sep 29, 2005
Loading...

Share This Page