newbie postback question about ASP controls

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
 
K

Ken Dopierala Jr.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top