[英]popup window with confirmation box in asp.net
Hi I am trying to display a confirmation box
. 嗨,我试图显示一个confirmation box
。 I wrote the code below, and when I click the OK
or Cancel
buttons, it should close the popup window
. 我写了下面的代码,当我单击“ OK
或“ Cancel
按钮时,它将关闭popup window
。 But it's not closing for me. 但这对我来说还没有结束。 Can anyone help me solve this? 谁能帮我解决这个问题? Below is the html code
. 以下是html code
。 One more thing. 还有一件事。 If I use javascript
it shows error $
is undefined. 如果我使用javascript
则显示错误$
未定义。 Can anyone help me solve this or suggest other options? 谁能帮我解决这个问题或提出其他选择?
<div class="box">
<a class="button" href="#popup1">Let me Pop up</a>
</div>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Here i am</h2>
<a class="close" href="#">×</a>
<div class="content">
Thanks for pop me out of that button, but now i'm done so you can close this window.
</div>
<asp:Button ID="btnOk" runat="server" Text="OK" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</div>
Try like this 这样尝试
function close_window() {
if (confirm("Close Window?")) {
close();
}
}
with HTML: 使用HTML:
<a href="javascript:close_window();">x</a>
or: 要么:
<a href="#" onclick="close_window();return false;">x</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.