You can use the ItemDataBound event to set a property value in the
RepeaterItem that you can retrieve when processing on PostBack.
While you don't say much about how you're using the repeater or accessing
the User Controls, a common method is to assign a value to the
CommandArgument property of a Button in your RepeaterItem from within the
ItemDataBound event handler. Then, in your event handler for ItemCommand,
you can test the value of the CommandArgument or for whatever other property
you set in your ItemDataBound handler. If your Button exists in the User
Control then just expose the Button's CommandArgument property through the
User Control.
Also, if you use the ItemCommand event to trigger your processing, you can
access the specific User Control instance by using something like this:
MyUserControl myControl =
(MyUserControl)e.Item.Controls[indexOfUserControl];
That would give you access to the individual User Control.
Don't make the mistake of using Item.Index to establish which item was
clicked or which item you're responding to in your PostBack processing. If
the database has changed then the contents of your Repeater.DataSource may
not be the same in PostBack as they were initially.
HTH
DalePres
MCAD, MCDBA, MCSE
<an**@anon.com> wrote in message
news:ce********************************@4ax.com...
I am having a hard time with makeing what I am trying to do work. I
am making a questionaire web app. I have a custom control that has a
label and 5 radio buttons. My problem is that each different topic
for the questionaire is in a database and each questionaire will have
a different number of questions. I am trying to use a repeater to
creat multiple copies of the control, unfortunately when I do this the
different controls act like thay are the same. Can anyone give me a
way to do what I am trying? Thanks alot