到目前为止,发生错误的原因可能是当页面索引更改时,由于模式中 gridview 的 databin-6ren">
gpt4 book ai didi

jquery - gridview页面索引更改错误: The state information is invalid for this page and might be corrupted(alternative solution needed)

转载 作者:行者123 更新时间:2023-12-01 04:48:09 25 4
gpt4 key购买 nike

引导模式是使用远程生成的

 <a data-toggle="modal" data-target="#modal-panel" href="AdminUserMaintenance.aspx?id=<%# Eval("ProviderUserKey")%>" title="Edit" class="button-icons"><span class="glyphicon glyphicon-pencil"></span></a>

到目前为止,发生错误的原因可能是当页面索引更改时,由于模式中 gridview 的 databind() 导致 __viewstate 发生更改,如果我将 gridview 从 Bootstrap 移动到新页面,则 gridview分页工作正常,如果在boostrap模式中,第一次点击任何分页后,第二次点击分页会遇到错误,有什么替代方法吗?

部分错误

System.Web.HttpException (0x80004005):此页面的状态信息无效,并且可能已损坏。 ---> System.Web.UI.ViewStateException:无效的 View 状态。

enter image description here

代码隐藏

Protected Sub gvAdminUser_PageIndexChanging(sender As Object, e As GridViewPageEventArgs)
gvAdminUser.PageIndex = e.NewPageIndex
bindDataGrid()
End Sub

Private Sub bindDataGrid()
gvAdminUser.PageSize = _iMaximumRows
Dim oUser As MembershipUser = Membership.GetUser(UserID)
gvAdminUser.DataSource = Roles.GetAllRoles
gvAdminUser.DataBind()
End Sub

引导表单的一部分

<asp:UpdatePanel ID="pnlUpdate" runat="server">
<ContentTemplate>
<asp:GridView ID="gvAdminUser" runat="server" AutoGenerateColumns="false"
AllowPaging="true" EmptyDataText="No Data Found" BorderStyle="None"OnPageIndexChanging="gvAdminUser_PageIndexChanging">
<PagerSettings Mode="Numeric" Position="TopAndBottom" />
<Columns>
<asp:TemplateField HeaderText="Role" HeaderStyle-Width="40%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label runat="server" ID="RoleNameLabel" Text='<%# Container.DataItem %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

到目前为止的引用

ASP.NET Error:The state information is invalid for this page and might be corrupted

http://blog.syedgakbar.com/2007/11/one-possible-reason-for-the-state-information-is-invalid-for-this-page-exception/

The state information is invalid for this page and might be corrupted. (Only in IE)

http://social.msdn.microsoft.com/Forums/vstudio/en-US/cc8b2fe2-ede4-4c95-b1a9-ed9002e6a0b7/the-state-information-is-invalid-for-this-page-and-might-be-corrupted?forum=netfxbcl

最佳答案

只是猜测,

所以你提到模式是使用远程生成的,这可能是你的 View 状态无效的原因。尝试在页面和模态上查看源代码,看看它们是否都生成了 View 状态。

看起来像这样

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="SOMESTUFFHERE" />

如果您确实有两个 View 状态,请尝试使用 JavaScript 删除模式弹出窗口上的 View 状态,如果这不起作用,请尝试从服务器响应(生成模式的响应)中删除 View 状态

关于jquery - gridview页面索引更改错误: The state information is invalid for this page and might be corrupted(alternative solution needed),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25762770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com