本文介绍了从asp服务器端的确认框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想告诉从服务器端在asp确认框:
I want to show the confirmation box in asp from server side:
我想从服务器端调用它,因为我不得不采取从服务器端的客户信息。我使用的是低于code
I want to call it from server side because I have to take the customer message from server side. I am using the below code
string str = "Are you sure, you want to Approve this Record?"; ClientScript.RegisterStartupScript(typeof(Page), "Popup", "return confirm('" + str + "');",true); // More code ....现在它显示弹出式窗口,不管什么我点击,无论是OK或取消,我的code正在执行。
Now it is showing the popup and irrespective of what I click, whether "ok" or "Cancel", my code is executing.
请让我知道我怎么能限制code被执行时,用户在确认对话框中选择取消。
Please let me know how can I restrict code to be executed when user select "cancel" in the confirmation box.
推荐答案检查出来:
code背后:
string str = "Are you sure, you want to Approve this Record?"; this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "ConfirmApproval('" + str + "');", true);ASPX:
function ConfirmApproval(objMsg) { if(confirm(objMsg)) { alert("execute code."); return true; } else return false; }更多推荐
从asp.net服务器端的确认框
发布评论