gpt4 book ai didi

ASP.NET - Microsoft JScript 运行时错误 : Sys. WebForms.PageRequestManagerServerErrorException:无效的回发或回调参数

转载 作者:行者123 更新时间:2023-12-02 16:37:37 25 4
gpt4 key购买 nike

我不明白为什么会发生这种情况。我将以下代码添加到我的 ASP.NET 项目中,几天前它运行得很好。然后我继续在该页面上工作,直到今天我尝试单击下面代码中的“验证”按钮,结果如下:

首先这是 asp.net 代码:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="TextVerifyName" runat="server" CssClass="input1" EnableViewState="false"></asp:TextBox>
<asp:Button ID="ButtonVerifyName" runat="server" Text="Verify" CssClass="checkButton" onclick="ButtonVerifyName_Click" />
<asp:UpdateProgress ID="UpdateProgressVerifyName" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="Graphics/spinner.gif" alt="Please wait" />
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
  1. 第一次点击“验证”按钮时,代码运行正常。
  2. 第二次运行时出现以下错误:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

有人可以解释为什么会发生这种情况吗,因为上面的错误消息只不过是 100% 令人困惑???
我没有使用 ClientScriptManager.RegisterForEventValidation 方法执行任何操作。

最佳答案

尝试将您在 page_load 事件中指定的任何函数/绑定(bind)放入

if(!IsPostback)
{

}

可能会有所帮助。

关于ASP.NET - Microsoft JScript 运行时错误 : Sys. WebForms.PageRequestManagerServerErrorException:无效的回发或回调参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8074138/

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