Ajaxcontrol工具包ConfirmButtonExtender与radiobuttonlist控件
我有一个“是/否”单选按钮列表,当加载 asp.net 页面时,如果 gridview 中有项目,则该单选默认为“是”。现在,如果用户单击“否”,我必须删除 gridview 的所有项目并将它们保留在数据库中。但我想确认用户是否想要继续执行此操作。如果用户单击“是”,则继续删除 gridview 中的行;如果否,则将原始单选设置保留为“是”。 我一直在努力让它像ConfirmButtonExtender一样工作,甚至在我知道在收音机上单击了什么之前,它就打开了一个模态弹出扩展器。如果使用“是”预先选择了无线电,那么如果我单击“否”,则会显示模态扩展器,并且在页面预渲染事件处理程序中,无线电的值仍然是“是”而不是“否”,因为扩展器是使用 ajax 在单击时运行的,并且它不知道无线电的正确值。即使我使用 onClick 客户端 JavaScript 来找出已选择哪个选项,困难还是对数据库执行服务器端删除命令。以前有人遇到过这个问题吗?任何解决方案将不胜感激。
I have a Yes/No Radiobutton List, When the asp.net page is loaded, if there are items in the gridview this radio is defaulted to Yes. Now if the user clicks no, I have to delete all the items for the gridview and persist them in db. But I want to show a confimation whether the user wants to go ahead doing this operation. If user clciks Yes then go ahead and delete the rows in gridview if no then keep the original radio setting to Yes.
I have been struggling to get this to work as the ConfirmButtonExtender which opens up a modalpopup extender even before I know what has been clicked on the radio. If the radio is preselected with Yes, then if I clcik no, the Modal extender is shown and in the Page PreRender event handler the value of the radio is still Yes and not No as extender is run on click using ajax and it doesnt know the correct value of the radio.Even if I use onClick client side javascript to find out which option has been chosen the difficulty is then executing the server side delete command to the db. Has anyone enconuntered this problem before? Any solutions would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论