A
A
Hi everybody,
I'm building a Web page in ASP.NET / C#.
On that Web page, there is a button that when clicked will add a Web User
Control (contains some labels, textboxes, radio buttons, and such). The user
can click that button many times, each time adding one additional Web User
Control. The user can also click another button to delete one of the Web
User Control.
The problem I'm having is that the ViewState data sometimes won't match with
the correct Web User Control on postback (e.g. happens if I delete a middle
Web User Control).
I did some searching for the solution online, and I understand that the
problem I'm having is normal because of the way the ViewState works. But I
can't find the solution. I even tried to rename the IDs of all my controls
within that Web User Control.
I hope someone can point me in the right direction. Thanks.
I'm building a Web page in ASP.NET / C#.
On that Web page, there is a button that when clicked will add a Web User
Control (contains some labels, textboxes, radio buttons, and such). The user
can click that button many times, each time adding one additional Web User
Control. The user can also click another button to delete one of the Web
User Control.
The problem I'm having is that the ViewState data sometimes won't match with
the correct Web User Control on postback (e.g. happens if I delete a middle
Web User Control).
I did some searching for the solution online, and I understand that the
problem I'm having is normal because of the way the ViewState works. But I
can't find the solution. I even tried to rename the IDs of all my controls
within that Web User Control.
I hope someone can point me in the right direction. Thanks.