Response.Cache.SetNoStore();You could also set this in the page declaration with:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="account.aspx.cs" Inherits="Main" Title="My Account" EnableViewStateMac ="false" EnableSessionState="True" EnableEventValidation ="false" ValidateRequest ="false" ViewStateEncryptionMode ="Never" %>
You could also add something like the below to Web.config:
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never">
3 comments:
Dear Mattio,
Wow...Great Post...I got the same problem "The state information is invalid for this page and might be corrupted" and tried on so many web sites for the solution. I couldn't find the solution and spent lot of my time. Your solution is exceptional and worked well. Thanks alot for your post.
Regards,
Veera.
shot mattio! u da man!
You guys rock! I just updated the web.config file with the information from this article and "voila!" A problem that I've been trying to get fixed for over two weeks is now magically resolved! Thank you!!!! :-)
Post a Comment