Gridview根据更新面板中的下拉列表进行更改 [英] Gridview Change according dropdownlist in Update Panel

查看:111
本文介绍了Gridview根据更新面板中的下拉列表进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新面板中有一个下拉列表和gridview,通过它,gridview中的数据将根据selectedindexchanged的下拉列表而变化.
但是,我只是收到了以前从未遇到过的这种错误.
这是什么意思,我该如何解决?

I have a dropdownlist and gridview inside an update panel whereby the data in gridview will change according to dropdownlist selectedindexchanged.
However, I just receive this kind of error which i never get before.
what does it mean and how can I solve this?

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: 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.

推荐答案

将下拉菜单置于更新面板的触发器内:
尝试以下代码:

Put your dropdown inside trigger of your update panel:
Try below code:

<asp:updatepanel>
           <triggers>
               <asp:asyncpostbacktrigger controlid="YourDropdown" eventname="SelectedIndexChanged" />
           </triggers>
       </asp:updatepanel>


这篇关于Gridview根据更新面板中的下拉列表进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆