English 中文(简体)
无效的背后或退约论点——Trerik电网的纽顿语
原标题:Invalid postback or callback argument - button in Telerik grid

Very famous error message (see below), judging by the number of Google results. But every one of them I ve seen suggests to set EnableEventValidation to false. I have searched my entire codebase, and I cannot find the string "EnableEventValidation" anywhere. Moreover, this code used to work; something I have done has obviously broken the pages. But what?

当我点击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>

点击“Cancel”纽吨,这里引出了著名的错误:

<编码> 无效的背后或背叛论点。 活动验证使用“带”;页面使EventValidation=“true”/> 配置或设计;%@p EnableEventValidation=“true” %> 网页。 为了安全起见,这一特点证明,关于退税或退税事件的论据源自服务器控制,而服务器控制最初正是这样。 如果数据有效且预期,则使用《客户手册》。 登记通风方法,以便登记回馈或回数据以供验证。

最佳回答

这里的问题是:在我的<编码>中。 页: 1 方法一:

protected void Page_Load(object sender, EventArgs e) {
  MyGrid.Rebind();
}

输电网的重新约束力显然使一些东西化为乌有。 我改为:

protected void Page_Load(object sender, EventArgs e) {
  if (!IsPostBack) {
    MyGrid.Rebind();
  }
}

and everything is working now.

问题回答

我也存在同样的问题,但我没有在我的需要DataSource方法或Load方法中找到Grid.Rebind()或Grid.Databind()。 这发生在我rag一栏被归类之后,然后命令将ASC/DESC栏归类。

我简单地补充说:

EnableEventValidation="false" 

页: 1 页: 1 命令失败,但至少我不再犯错误。 值得一提的是,除组别一栏的次序外,所有其他工作都是完美的。

这里使用的是《需要数据方法》中的代码一。

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        String connstr = ConfigurationManager.ConnectionStrings["PrimeIntegartionsConnectionString"].ConnectionString;

        SqlDataSource Ds = new SqlDataSource(connstr, BuildSql()); //buildsql simply returns a SQLSelect String "select * from example"
        RadGrid1.DataSource = Ds;
    }




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签