I recently did a similar task with a repeater. When using a repeater, it
will rename the controls within it so they have uniqe ID's.
Here's a basic example:
RepeaterName__c trl00_ControlNa me
ctrl00 is how many times it's looped through.
I had a button within a repeater, and this is how I found out what buttons
was pressed:
<asp:button cssclass="BoxTy pe42" value="Allow" id="btnAllow" name="Allow"
Text="DisAllow" onclick="Switch Item" runat="server" />
Code Behind:
Public Sub SwitchItem(ByVa l sender As System.Object, ByVal e As
System.EventArg s)
'**Let's say the item passed in was Repeater1__ctrl 01_btnSubmit
Dim btnTest As New Button
Dim astrTest As String()
btnTest = CType(sender, Button)
astrTest = btnTest.ClientI D.Split("_")
strControlsToEd it = astrTest(2)
....
End Sub
At the end, strControlsToEd it will contain ctrol01 (telling me what loop to
look for if I need to edit anything special within that one section of the
repeater).
astrTest(3) will give you "btnSubmit" .
If you need to loop through all items, look at the post started on July 23,
2004 by me and read the responses to it.
Hope this helps.
Ryan Ternier
Code Monkey
"Z D" <NO****@NOSPAM. com> wrote in message
news:OV******** ******@TK2MSFTN GP11.phx.gbl...
Hello,
I have a checkbox control as one of the items within my repeater control.
I've set the AutoPostBack=Tr ue on the checkbox.
How do I access the event (so that I can run some code) whenever someone
clicks on the checkbox? Also, how do I determine which checkbox was
clicked so that I can run the appropriate code?
thanks in advance,
-ZD