创建确认框 [英] Creating a Confirmation Box

查看:47
本文介绍了创建确认框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在添加一些细节。添加后我想向用户询问确认

你想继续......?如果他点击YES我想让他留下

同一页并添加新值。如果他点击NO ..我想将他重定向到

另一页。



请帮帮我..

I am adding some details..After adding I want to ask a confirmation to the user like
"Do u want to continue..?" If he click on YES I want to allow him to stay the
same page and add new values.If he clicks NO..I want to redirect him to
another page.

Please help me..

推荐答案

最简单的方法可能是使用JQuery(UI) 。它允许弹出对话框。通过javascript,您可以将页面重定向到您想要的位置。



JQuery [ ^ ]

JQuery.UI [ ^ ]



图书馆有一个完整的API和示例代码。弹出一个对话框就像设置一个DIV并调用两行(jquery)javascript一样简单。



希望这会有所帮助。
The easiest way is probably to use JQuery (UI). It allows to popup dialogs. Via javascript you can then redirect the page to where you want.

JQuery[^]
JQuery.UI[^]

the library has a full API and sample code. Popping up a dialog is as easy as setting up a DIV and calling two lines of (jquery) javascript.

Hope this helps.


是否在Asp.net中没有MessageBox


在.aspx中编写此java脚本





In .aspx write this java script


<script type="text/javascript">
       function myTestFunction() {
           if (confirm('Do you want to add another global Space ?')) {
               return true;
           }
           else {
               window.location.href = "Dashboard.aspx";
               return true;
           }
       }
   </script>









和后面的代码.........



保存后拨打这个电话\\





ScriptManager.RegisterStartupScript(this,typeof(string),confirm,

myTestFunction();,true);





and in code behind.........

call this after save \\


ScriptManager.RegisterStartupScript(this, typeof(string), "confirm",
"myTestFunction();", true);


这篇关于创建确认框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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