I am not able to understand the following : (It is related to adding viewstate support when creating custom web server controls)
“However, if these properties need to be manipulated inside code, you
might want to provide ViewState support to ensure a consistent developer experience
similar to that of other ASP.NET controls. This will ensure that the properties set inside
server code are not suddenly switched back to markup values after a postback.”
Can someone please elaborate ?
Thanks.
ViewState is used to maintain page state between postbacks. If your controls don’t persist their state as the page goes through its lifecycle, the next time the page loads they will revert to whatever values were originally provided by the developer in the ASP markup.