从asp.net服务器端的确认框

编程入门 行业动态 更新时间:2024-10-27 02:23:50
本文介绍了从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服务器端的确认框

本文发布于:2023-11-24 21:31:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626921.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器端   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!