What causes error: The state information is invalid for this page and might be corrupted.


Server Error in '/' Application.

The state information is invalid for this page and might be corrupted.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

 

'The following code will cause invalid state shown above: find the fix below in blue

<%@ Page Language="VB" debug="true" AutoEventWireup="true" CodeFile="getHintSearch.aspx.vb" Inherits="getHintSearch" EnableViewState="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>

<form id="form1" runat="server">
<div>
</div>
</form>

</body>
</html>


TO FIX

On your page that you are using as AJAX page - Turn EnableViewsate to false and turn AutoEventWireup to false in <Page declaration at top, the remove any form tag or div tags in your aspx page.

ALSO: in your web.config, you can try setting enableEventValidation to false on your <pages> declaration like this:

<system.web>
<pages theme="theme1" enableEventValidation="false" buffer="true">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=123123123"/>
</controls>
</pages>

 

 

 

Tags: .NET, invalid state, invalid view state
Last update:
2015-05-12 17:19
Author:
Mark
Revision:
1.0
Average rating: 1 (1 Vote)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags