- Example.
- Maintaining the ViewState is the default setting for ASP.NET Web Forms. By default, most ASP.NET controls enable view state. If you want to not maintain the ViewState, include the directive <%@ Page EnableViewState="false" %> at the top of an .aspx page or add the attribute EnableViewState="false" to any control. You can also maintain ViewState for all pages in a web.config file.
<configuration>
<system.web>
<pages
buffer="true"
enableSessionState="true"
enableViewState="true"
autoEventWireup="true"
/>
</system.web>
</configuration>
View state is a great idea to store information in a page, but if you wish to save more complex data, and keep them from page to page, you should look into using cookies or sessions is better.
0 comments::
Post a Comment