EasyDotNet - DataForm.NET V3.4 Developer Guide
How to Enable EasyViewState

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.

  1. Copy EasyDotNet.Web.dll file to bin folder.
  2. 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>
  3. 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>
  4. 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
    ***************************************************************************************************************************
    -->
  5. 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.
    Security Settings for EasyViewState folder

viewSTATE Settings

mode : Specifies where to store the viewstate state.

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:

  1. Use file name to exclude to a particular page:
    <add url="/yourFolder/yourPage.aspx" />
  2. Use file name with parameters. For instance, to exclude a page with specified parameters in the URL
    <add url="yourPage.aspx?param=value />
  3. 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" />
See also
DataForm.NET Manager | Change location of XML files | Change Language of Messages | Coding with eDataForm control | Samples
Syntax based on .NET Framework version 1.1/2.0.

Send feedback to EasyDotNet
© 2002-2007 EasyDotNet Corporation. All rights reserved.