Request.Form.Get 的问题
我有一个启用了自动回发的下拉列表。它包含多个值。在下拉列表的 selected_Index 更改事件中,我正在加载 gridview 并且它工作正常。我有一个名为clearall 的按钮,它应该将下拉列表索引更改为 0 和重置gridview,但是当我单击按钮时,它会将下拉索引更改为0,但不会重置gridview。gridview显示先前下拉列表选择的数据。当我第二次单击该按钮时,gridview被重置。
我用来
dRev = Request.Form.Get("ctl00$ContentPlaceHolder2$pnlSearchL2$i0$ddlDRevision");
获取下拉列表值并重置 gridview。看起来像 Request.Form.Get 在单击第一个按钮时获取旧值。我该如何解决这个问题?
I have a dropdown list which is autopostback enabled.it contains several values.On selected_Index change event of dropdown i'm loading a gridview and it works fine.I have a Button called clearall which is supposed to change the dropdown list index to 0 and reset the gridview but when i click on the Button it will change the dropdown Index to 0 but does not reset the gridview.gridview display data of previous dropdown list selection.when i click on the button for the second time gridview is reset.
i'm using
dRev = Request.Form.Get("ctl00$ContentPlaceHolder2$pnlSearchL2$i0$ddlDRevision");
to get the dropdownlist value and reset the gridview.looks like Request.Form.Get gets the old value on first button click.how can i solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不如在点击事件处理程序中使用
Request.Form.Get('...')
调用Dropdown_SelectedIndexChanged(sender, e)
怎么样?How about instead of using
Request.Form.Get('...')
to callDropdown_SelectedIndexChanged(sender, e)
in your click event handler?