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,
JimHi 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.
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
"Jim Bancroft" <bobgambles@.nowhere.com> wrote in message
news:epGzj$koEHA.3668@.TK2MSFTNGP15.phx.gbl...
> 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
>
Thanks for the explanation and help, Ken! Good stuff below.
-Jim
"Ken Dopierala Jr." <kdopierala2@.wi.rr.com> wrote in message
news:%23FEbSHloEHA.2864@.TK2MSFTNGP12.phx.gbl...
> 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.
> --
0 comments:
Post a Comment