asp.net 中服务器端的确认框
我想从服务器端显示 ASP.NET 中的确认框:
我想从服务器端调用它,因为我必须从服务器端获取客户消息。我正在使用下面的代码
string str = "Are you sure, you want to Approve this Record?";
ClientScript.RegisterStartupScript(typeof(Page), "Popup", "return confirm('" + str + "');",true);
// More code ....
现在它显示弹出窗口,无论我单击什么,无论是“确定”还是“取消”,我的代码都正在执行。
请让我知道当用户在确认框中选择“取消”时如何限制执行代码。
I want to show the confirmation box in asp.net from server side:
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 ....
Now it is showing the popup and irrespective of what I click, whether "ok" or "Cancel", my code is executing.
Please let me know how can I restrict code to be executed when user select "cancel" in the confirmation box.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查一下:
背后代码:
ASPX:
Check it out:
CODE BEHIND:
ASPX:
检查以下示例代码。
在服务器端......
http://forums .asp.net/t/1499789.aspx?确认+弹出+来自+服务器+端
check following example code.
On server side.....
http://forums.asp.net/t/1499789.aspx?confirmation+popup+from+server+side