我想添加一个简单的确认,当您单击执行回发的 asp:button 时您确定对话框。 像这样的东西:
OnClientClick="if(confirm('Format the hard disk?'))
alert('something');
else alert('something else')"
问题是,无论您单击“确定”还是“取消”,它仍然会回发。 如何使它只在 OK 时回发?
最佳答案
如果您只是想根据确认对话框中的选择进行回发,这可能会更简单:
OnClientClick="return confirm('Are you sure?');"
关于c# - ASP :button and javascript popup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11543139/