该页面的状态信息无效,并且可能已损坏. [英] The state information is invalid for this page and might be corrupted .

查看:71
本文介绍了该页面的状态信息无效,并且可能已损坏.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击按钮,链接按钮或数据列表项命令时遇到此错误.
我改变了

I face this error when I click on button ,Linkbutton or datalist item command.
I change

<page enableeventvalidation="false"></page>


在Web配置文件中.已改写此错误,但现在不会发生此事件.
我在google上搜索.但是我的问题没有解决.请帮帮我.
完整的错误是


in web config file.This erropr is reomved but now event does not occurs.
I serch on google.but my problem does not solve.Please help me.
the complete Error is

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.
 
Source Error: 
 

[No relevant source lines]
 
 
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\portal9161new\1f521660\5181c4db\App_Web_mryexrix.10.cs    Line: 0 
 
Stack Trace: 
 

[FormatException: Invalid character in a Base-64 string.]
   System.Convert.FromBase64String(String s) +0
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +57
 
[ViewStateException: Invalid viewstate. 
	Client IP: 127.0.0.1
	Port: 
	User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSN Optimized;US)
	ViewState: /wEWFwLO08XUCALz3vPHCwKzrv6wAwK9vJ38DAKpi4ufBQKIgpWfBQLrmZefBQLKkICfBQK98JOfBQKc5/2WBQL//veWBQLe9YifBQLj4JT2BwLUk/WqAgKOkrn2CAKLkrn2CALCvJnnBAK//ZjtBwLNzIK2CALsjZ7JCALgutCTDwKLlba1BgLBzqW+BXf/jiRHAjSf0ntN+9hIlN0OfE3b,/wEWEQKIr8XKBALE5ML0AgLl97ftDQLb44SECwLb4+iFCwLR5JWQCwKBp/mABQL3meq7DgLqwoebCwL14vPbCQKe5MqPCQKNo6XnBAKe8IG6DAKipuWCDAK33sGJAQK33rWJAQLk97ftDfQ62Og2DDwFHqA1OfwvN70aZODt
	Referer: http://localhost:4424/Portal9161new/seatingplan.aspx
	Path: /Portal9161new/seatingplan.aspx]



页面代码之一是



one of the page code is

<%@ Page Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="seatingplan.aspx.cs" Inherits="seatingplan" Title="SeatingPlan" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ImageButton ID="ImageButton6" runat="server"  

            ImageUrl="~/Image/animated-globe2.gif"  width="36" border="0" height="24" />
      
    <asp:HyperLink ID="HyperLink8" runat="server"><font color="#000080" size="4">Seating 
plans</font>   
    <br />
    <span>
    <hr width="100%" /></span><br />

<div style="width:100%">        
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" 

	RepeatColumns="4" BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" 

	 BorderWidth="1px" CellPadding="4" GridLines="Both" 

        onitemcommand="DataList1_ItemCommand" Width="100%" 

        style="font-size: x-small" >          
        <footerstyle backcolor="#FFFFCC" forecolor="#330099" />
        <itemstyle backcolor="White" forecolor="#330099" />
        <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
        <itemtemplate>                 
          <asp:ImageButton ID="ImageButton1" runat="server" Height="120px" Width="196px" ImageUrl=' <%#Eval("url")%>' CommandName="select" CommandArgument='<%#Eval("url") %>' />
            <br />
             Head Line : <%#Eval("title") %> 
                  <br />
          </itemtemplate>
    
    <table align="center" width="100%" border="0">
<tr>
<td align="center"><asp:label id="lblCurrentPage" runat="server" CssClass="style51"></td>
</tr>
<tr>
<td align="center"><asp:button id="cmdPrev" runat="server" text=" << " onclick="cmdPrev_Click" 

        Width="65px">

     <asp:button id="cmdNext" runat="server" text=" >> " onclick="cmdNext_Click" 

        Width="65px"></td>
</tr>
</table>
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 

        ConnectionString="<%$ ConnectionStrings:cnn %>" 

        SelectCommand="SELECT [title],[url] FROM [seatplan]">
     
  
</div>    


<asp:Content ID="Content3" runat="server" 

    contentplaceholderid="ContentPlaceHolder2">
    <style type="text/css">
    .style51
    {
        color: black;
    }
</style>


当我单击数据列表项时发生错误


error occured when i click on data list item

推荐答案

ConnectionStrings:cnn %> " span> SelectCommand =" 从[seatplan]中选择[title],[url]" < /div > < asp:Content ID =" runat 服务器" contentplaceholderid =" ContentPlaceHolder2" < 样式 =" text/css" style51 { 颜色 : 黑色; } </ 样式 >
ConnectionStrings:cnn %>" SelectCommand="SELECT [title],[url] FROM [seatplan]"> </div> <asp:Content ID="Content3" runat="server" contentplaceholderid="ContentPlaceHolder2"> <style type="text/css"> .style51 { color: black; } </style>


当我单击数据列表项时发生错误


error occured when i click on data list item


尝试在页面指令中使用ViewStateEncryptionMode="Never".
Try ViewStateEncryptionMode="Never" in page directive.


这篇关于该页面的状态信息无效,并且可能已损坏.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆