gpt4 book ai didi

c# - 无效的回发不允许验证

转载 作者:行者123 更新时间:2023-11-30 17:37:52 25 4
gpt4 key购买 nike

我有两个使用 javascript 移动项目的列表框。这些项目正在正确移动,但是当我按下保存按钮时,出现此错误:

Invalid postback or callback argument.

使用 <pages enableEventValidation="true"/> 启用事件验证在配置中或 <%@ Page EnableEventValidation="true" %>在一个页面中。出于安全目的,此功能验证回发或回调事件的参数是否源自最初呈现它们的服务器控件。如果数据有效且符合预期,请使用 ClientScriptManager.RegisterForEventValidation方法来注册回发或回调数据以进行验证。

我的aspx:

<asp:UpdatePanel ID="update" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSave" />
</Triggers>
<ContentTemplate>
<table >
<tr>
<td>
<asp:ListBox ID="lstbx" runat="server" ClientIDMode="Static" ></asp:ListBox>
</td>
<td>
<a href="#" id="movenext" class="anchor">Move ></a>
<a href="#" id="moveprev" class="anchor">< Move</a>
</td>
<td>
<asp:ListBox ID="lstbx2" runat="server" ClientIDMode="Static" ></asp:ListBox>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

<p class="btnCentre">
<asp:Button runat="server" ID="btnSave" Text="Save" ValidationGroup="ValGroup" CausesValidation="true" />
<asp:Label runat="server" ID="lbl_Savemsg"></asp:Label>
<asp:Button runat="server" ID="btnCancel" Text="Cancel" CausesValidation="false" />
<asp:HiddenField runat="server" ID="hiddenfield" />
</p>

最佳答案

您需要将 enablevalidation 更改为 false
来自

<pages enableEventValidation="true"/> 

<pages enableEventValidation="false"/>

关于c# - 无效的回发不允许验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37314256/

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