EasyViewState removes
viewstate from web pages and keeps them on the server. Thus, it reduces the size of web pages and provides noticeable performance improvement
To enable EasyViewState, there is no code changes nor compilation needed. You just need to configure the web.config file. There are three places in web.config needed to be configured.
- Copy EasyDotNet.Web.dll file to bin folder.
- Copy&Paste the following code to web.config between <configuration> and </configuration> element at the top of the file.
<configSections>
<sectionGroup name="EasyDotNet.Web">
<section name="viewState" type="EasyDotNet.Web.Configurations.ViewStateConfigurations.ViewStateConfigurationHandler,
EasyDotNet.Web"/>
</sectionGroup>
</configSections>
- Copy&Paste the following code to web.config between <system.web> and </system.web> element.
<httpModules>
<add name="ViewStateProvider" type="EasyDotNet.Web.HttpModules.ViewStateModule.ViewStateHttpModule,
EasyDotNet.Web"/>
</httpModules>
- Copy&Paste the following code to web.config after <system.web> </system.web> element, but within <configuration> </configuration> element.
<!--
***************************************************************************************************************************
Begin EasyDotNet.Web Settings
***************************************************************************************************************************
-->
<EasyDotNet.Web>
<viewState mode="File" databaseConnection="" databaseType="" timeout="20" filePath="~\EasyViewState">
<excludeURL>
<add url="" />
</excludeURL>
</viewState>
</EasyDotNet.Web>
<!--
***************************************************************************************************************************
End EasyDotNet.Web Settings
***************************************************************************************************************************
-->
- You may need to grant ASP.NET worker process Read, Write and Modify permission on EasyViewState folder if you want to use File mode to store viewstate.

viewSTATE Settings
mode : Specifies where to store the viewstate state.
- Cache - For small web site or when memory is not a problem
- Database - Recommended for a large web site or web farm is used.
- File - Recommended for any sizes of web sites.
- None.
databaseConnection : Specifies the connection string for a database,
OR the connection name created in DataForm.NET Manager.
databaseType : Specifies the database type. Valid values: SQLServer, Oracle
timeout : Specifies the number of minutes a viewstate can be idle before it is removed. The default is 20 minutes.
filePath : The location where viewstate will be stored when mode is set to File.
ASP.NET worker process must have read, write and delete permission on that folder. Default folder is EasyViewState
To exclude some particular pages from being processed by EasyViewState module, there are three approaches:
- Use file name to exclude to a particular page:
<add url="/yourFolder/yourPage.aspx" />
- Use file name with parameters. For instance, to exclude a page with specified parameters in the URL
<add url="yourPage.aspx?param=value />
- Use Regular Expression. For instance, to exclude all aspx files whose names start with "t"
<add url="/t.*\.aspx" />
OR exclude an extension.
<add url="/.*\.aspx" />