newbie postback question about ASP controls

  • Thread starter Thread starter Jim Bancroft
  • Start date Start date
J

Jim Bancroft

Do I understand correctly that my aspx webpage's DataGrid, Button and web
control states are somehow stored in the "_VIEWSTATE" hidden input value,
making it unneccesary to recreate their content in the case of page
postbacks? Or are there gotchas I need to look out for in assuming these
controls will work correctly, and have their former values available, after
a postback?

Thanks,

Jim
 
Hi Jim,

You are correct for your server controls. The ones that start <asp:....>.
You can also add your HTML control to the _VIEWSTATE by giving them the
runat="Server" attribute. For example: <input type="hidden" id="hidValue"
runat="server"> will add this control to view state and it will retain its
value between postbacks. Good luck! Ken.
 
Back
Top