非常着名的错误消息(请参见下文),由Google结果的数量来判断。但他们中的每一个人都建议将EnableEventValidation
设置为false
。我搜索了我的整个代码库,并且我找不到任何地方的字符串“EnableEventValidation”。而且,这个代码使用工作;我所做的一切显然已经打破了页面。但是什么?无效的回传或回调参数 - Telerik网格中的按钮
当我点击一个Telerik的radgrid控件中的按钮错误发生,声明如下:
<telerik:RadGrid ID="MyGrid" Width="100%" ItemStyle-BorderColor="Gainsboro"
ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1px" ActiveItemStyle-BackColor="Bisque"
SelectedItemStyle-BackColor="Black" AllowPaging="True" PageSize="15" runat="server"
AllowSorting="true" OnItemCommand="MyGrid_ItemCommand" AutoGenerateColumns="false"
OnNeedDataSource="MyGrid_NeedDataSource" GridLines="Horizontal" AllowMultiRowSelection="false"
Skin="Black">
<GroupingSettings CaseSensitive="false" />
<MasterTableView Width="100%" DataKeyNames="ID" AllowFilteringByColumn="false" Font-Names="Arial"
Font-Size="10px">
<Columns>
<telerik:GridButtonColumn ButtonType="PushButton" Text="Cancel" CommandName="Cancel"
ConfirmText="Are you sure you want to cancel this?">
</telerik:GridButtonColumn>
...
</Columns>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" />
<FilterMenu EnableTheming="True">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
点击 “取消” 按钮,这里是著名的错误:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> 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.