如何在c#.net文件后面的代码中为确认框编码 [英] how to code for confirm box in code behind file of c#.net

查看:89
本文介绍了如何在c#.net文件后面的代码中为确认框编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#.net文件后面的代码中为确认框编码...如果我点击是它应该重定向到index.aspx页面如果我点击否它应该保留在同一页面中。任何人都帮我

how to code for confirm box in code behind file of c#.net...if i click yes it should redirect to index.aspx page if i click no it should remain in same page.can anyone help me

推荐答案

您需要阅读BASIC ASP.NET书籍。您无法在代码中显示UI,因为它在服务器上运行。你的客户不会看到它。你需要用javascript来做。如果您需要计算是否这样做,在服务器上,最好的方法是使用AJAX来查找。否则,在客户端上进行并从那里重定向。
You need to read a BASIC ASP.NET book. You can''t show UI in your code behind, as it runs on the server. Your client won''t see it. You need to do it with javascript. If you need to calculate if you do it, on the server, the best way is to use AJAX to find out. Otherwise, do it on the client and redirect from there.


我完全同意 Christian Graus 。但是我们可以有另一种选择。对于一个简单的确认框,我们可以显示一个ModelPopupExtender,其中有两个按钮,分别是确认取消

查看示例确认框:

ASP.NET AJAX ModalPopup确认删除 [ ^ ]





--Amit
I am totally agree with Christian Graus. But we can have an alternate option for it. For a simple confirmation box we can show a ModelPopupExtender with two buttons saying Confirm and Cancel.
See a sample confirm box:
ASP.NET AJAX ModalPopup to Confirm Delete[^]


--Amit


这篇关于如何在c#.net文件后面的代码中为确认框编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆