In my sample asp.net app, that can be found here , I create dynamic controls on Page Init.
Then if the user enters text in the controls and the button is clicked, all the controls should be recreated with new values.
The page overwrites the populated values in the first row with the user’s manually entered data.
Any ideas on how to prevent this without changing to html controls or MVC ?
I ended up doing a workaround to keep state myself where I add a querystring variable to tell my code if its first load or postback. The I redirected to the same page with the new variable which forced the controls to be cleared.
Another way would have been to check IsPostBack on form load and replaced the ViewState assigned values again from my stored object values.
Still cant see why by disabling Viewstate on page and controls it still populates my dynamic controls with viewstate values.