开发者

DataGrid editcommand in UpdatePanel

My page uses Multiview with 3 views.

the third view for searching and has a datagrid in updatepanel, in datagrid has editcommand column. when user click edit on edicommand comlumn, the activeviewindex of multiview set to 1, but it throws and postback error.

"Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"开发者_如何学Go/> 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."

I think my problem is activeviewindex method, because when user click edit on editcommandcolumn, I set activeviewindex to 1, while my datagrid is inside updatepanel and updatepanel in view 3. How can I fix it?


I think there are some options to consider:

  1. If you don't care too much about security you can turn off event validation on that page.
  2. Why are you using an update panel if when editing the grid you go to another view? Consider giving it up.
  3. Try to put all three views within a single update panel.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜