I am experiencing a problem with ViewState on re-post when I create controls dynamically. I cannot get the value of the dynamically created controls on the post back. As I understand, I have to recreate the controls in Page_Init event so that I can retrieve the values. BUT my problem is I don’t know the control names.
I create textboxes dynamically and name them as ‘txtStaff’ and staff_id. For instance ‘txtStaff12’ where staff_id is 12. My problem is I cannot recreate the textboxes in Page_Init as I don’t know the control names. I also am not able to access any values in ViewState. Can you pls. let me know a way to get around this?
Thank you for any help.