[英]confirmation popup message (ASP.NET/VB)
当用户单击表单上的取消按钮时,我希望弹出一个确认消息框。 我相信这将是正确的 javascript 代码:
function confirmation() {
var answer = confirm("Are you sure you want to cancel? Any information you have entered will be discarded.")
if (answer) {
window.location = "index.htm";
}
}
但是,我不确定如何从我的页面后面的代码中使用 VB 调用 function。
在您的取消按钮上添加此标记属性
OnClientClick="return confirmation();"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.