I have a problem whereby the viewstate of a repeater i.e. the controls within the repeater are not maintaing their viewstate.
I have the following:
Repeater
I don't see the point of copying the CommandArgument
property to a hidden field. What you should do is to use the ItemCommand
event on the Repeater
and use event bubbling. You can handle the Click
event on you LinkButton
like this:
repeater.ItemCommand += (sender, eventArgs) => {
var commandArgument = eventArgs.CommandArguments;
ImageList.Add(commandArgument);
rptSelectedImages.DataSource = ImageList;
rptSelectedImages.DataBind();
}