Modalpopup 阻止 Gridview 上的回发
每当我将 ModalPopup 添加到页面中时,请设置 ok controlid、cancelcontrol id 和目标控件 id = hide fieldId。将 Gridview 数据绑定到某些数据并添加一个按钮,将模板字段链接到导致 ItemCommand 事件的 gridview,然后单击该按钮它不会执行任何操作。除非你打开modalPopup并再次关闭它。
您可以使用一些示例数据来复制相同的内容。
1.添加一个带有事件驱动控件(如链接按钮、按钮等)的 Gridiview,这些控件会导致回发、RowCommand 事件。
2.添加modalPopup扩展器。为其添加一个面板。将扩展程序的targetcontrolId设置为页面上的隐藏字段。
- 现在尝试启动应用程序并单击引发 Rowcommand 事件的按钮。它什么也做不了。我还是不明白为什么会这样!!
Whenever i add a ModalPopup into the page set the ok controlid, cancelcontrol id and target control id = hidden fieldId. Databind a Gridview to some data and add a button, link template field to the gridview which causes the ItemCommand event and click that button it would do nothing. Unless you open the modalPopup and close it again.
You can replicate the same using some sample data.
1.Add a Gridiview with Event driven control like linkbutton, Button etc that causes Postback, RowCommand event.
2.Add a modalPopup extender. Add a panel for it. Set the targetcontrolId of the extender to Hidden field on the page.
- Now try launching the application and Clicking the button that raises Rowcommand event. It would do nothing. I still don't understand why this happens!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当模式弹出控件的目标控件 ID 是隐藏字段时,会发生这种情况。我将其替换为 Button 控件,并确保使用 css 隐藏它并添加以下代码,
onclick 是为了避免在有人通过设置显示 css 属性取消隐藏按钮并单击它时发回。
This happens when the target control ID for the modal popup control is a hidden field. I replaced it with a Button controls and do make sure you hide it with css and add below code
the onclick is to avoid posting back if someone unhides the button by setting display css attribute and clicks it.