ASP.NET Nested Repeater Accessing elements
Posted
by Rich
on Stack Overflow
See other posts from Stack Overflow
or by Rich
Published on 2009-07-20T11:34:45Z
Indexed on
2010/04/03
6:23 UTC
Read the original article
Hit count: 358
I have a list of Accommodation objects bound to a Repeater, and then a nested Repeater which has the various attendee groups listed [e.g. Default, Seniors, Juniors]. This is all output fine, with the values displayed as LinkButtons, which when clicked gets sent to a code-behind event handler.
Here is an example of the output to give you a picture [with some er... interesting attendee group names]:
In the event handler, I test the object parameter to see which Repeater has been sent, as the outer repeater's links can also be clicked [so the Accommodation would be set, but no Attendee Group].
Is there a way to get a HiddenField from the outer RepeaterItem that contains the currently clicked inner repeater's LinkButton? E.g. From the image, I click the Attending link in the Women section. So the EventArgs via FindControl can get me the hidden field which contains the Attendee Group's ID, which is good, but I also need the Accommodation ID [to know whether it was either Wimbledon Hotel Inn or New Acc]
© Stack Overflow or respective owner