LinkButtons within a Repeater Control

Discussion in 'ASP .Net Web Controls' started by Majek, Nov 11, 2004.

  1. Majek

    Majek Guest

    I have created a repeater with a linkbutton for each databound item.

    When I fire off the repeater controls ItemCommand I execute the following...

    For indx = 0 To rpContacts.Items.Count - 1
    Dim btnMyContact As LinkButton =
    CType(rpContacts.Items(indx).FindControl("btnContact"), LinkButton)
    ....

    NEXT

    This works and I can access all of the properties of the linkbutton

    What I need to do is determine which linkbutton was clicked and then fire
    off a click event for that button.

    any suggestions?

    Gary T.
     
    Majek, Nov 11, 2004
    #1
    1. Advertising

  2. Yes. Fire Command event and when you databind your repeater set linkbutton's
    CommandArgument and if you need more even CommandName. There should be only
    one command event handler for all linbuttons created this way and you will
    know by CommandArgument which one fired it.

    --
    RobertK
    { Clever? No just smart. }

    "Majek" <> wrote in message
    news:...
    > I have created a repeater with a linkbutton for each databound item.
    >
    > When I fire off the repeater controls ItemCommand I execute the

    following...
    >
    > For indx = 0 To rpContacts.Items.Count - 1
    > Dim btnMyContact As LinkButton =
    > CType(rpContacts.Items(indx).FindControl("btnContact"), LinkButton)
    > ...
    >
    > NEXT
    >
    > This works and I can access all of the properties of the linkbutton
    >
    > What I need to do is determine which linkbutton was clicked and then fire
    > off a click event for that button.
    >
    > any suggestions?
    >
    > Gary T.
    >
    >
     
    Robert Koritnik, Nov 12, 2004
    #2
    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. =?Utf-8?B?TWFqZWs=?=

    LinkButtons within Repeater control

    =?Utf-8?B?TWFqZWs=?=, Nov 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    455
    Scott Allen
    Nov 11, 2004
  2. Mark
    Replies:
    2
    Views:
    417
    Allen Chen [MSFT]
    Jan 21, 2009
  3. Jan Limpens

    How can I use working Linkbuttons within a Web Custom Control?

    Jan Limpens, Oct 14, 2003, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    183
    John Saunders
    Oct 14, 2003
  4. Wozza

    Creating LinkButtons in a Repeater ... in code.

    Wozza, Dec 8, 2006, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    216
    Wozza
    Dec 14, 2006
  5. Jan Limpens
    Replies:
    3
    Views:
    199
    Steve Drake
    Oct 15, 2003
Loading...

Share This Page