Posted 11/2/2009 5:28:07 PM
|
|
|
|
| using ASP.NET 3.5, I have a form that users fill out and submit. If they take too long to fill it out, the web server presents an error page with "Validation of viewstate MAC failed". How long does the re-invent web server keep sessions alive, and how can I extend it? I've tried these things that did not work: page.EnableViewStateMac = False on the page load event me.EnableViewState = False
|
|
Posted 11/2/2009 7:03:11 PM
|
|
|
|
| The servers IIS app pools are set for 20 minute inactivity session timeout. A pool may recycle if the it execceds the maximum about of dedicated memory to it which is set for 125MB or if the pool uses excessive CPU usage. For example if the pool uses 90% of all available CPU power for over 1 minute. You may want to check these criteria and possible hard code a validation into your web.config. Example: Configure ASP.NET to not use Auto-Generated Key but rather a predefined key. This is the preferred method.
To do this, follow these steps:
a) Either build your own Key Generator (http://support.microsoft.com/kb/313091/EN-US/) or use this tool (http://www.aspnetresources.com/tools/keycreator.aspx). If using the online tool:
b) In the online tool, simply click on “Generate”.
c) Copy the content in the textbox into your site’s web.config file. The machineKey node should be within <system.web>
eg.
<?xml version="1.0"?>
<configuration> <appSettings/> <connectionStrings/> <system.web> <machineKey validationKey="2EEA416CEFC6D6BE856ED57B97FB9BA7DFCCE17C073125949A1D682C80A44BB2A D887DDDE13DBFB0954F1000FFE5757E99693F222F8E28CAC2E6DAB8C4F99E0C" decryptionKey="877478B2F33A74226ABEF55FDCC1A76E43F1BBEA6241A592" validation="SHA1" /> <compilation debug="false"/> <authentication mode="Windows"/> <pages enableViewStateMac="true"/> </system.web> </configuration>
For more information on ViewState troubleshooting, see http://support.microsoft.com/default.aspx?scid=kb;EN-US;829743
Paul BRe-invent Technologies LLC http://www.re-invent.com
Innovative ASP.NET 3.5/2.0 Hosting Now with Windows 2008 Hosting and SQL 2008 Celebrating 10 Years in Business!
|
|
Posted 11/3/2009 4:50:00 PM
|
|
|
|
| Many thanks, Paul - that resolved the issue for me.
|
|
|
|