LinkButtons within a Repeater Control

M

Majek

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.
 
R

Robert Koritnik

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top