在Asp.net中带有“是"没有按钮的消息框 [英] Message Box with Yes no button in Asp.net

查看:68
本文介绍了在Asp.net中带有“是"没有按钮的消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用C#的ASP.net项目.在那里,我想显示一个消息框,其中包含没有按钮,下面是没有按钮.如果我单击是",则发生一个事件;如果我单击否",则另一个发生.请以最简单的方式帮助我.

I have a ASP.net Project with C#. There I want to show a message box with yes no button under without button post. if i click yes the one happen done if i click no then another happen done. Pleas help me with simplest way.

推荐答案

带有是无按钮的消息框
为此,您需要 VBScript确认而不是Javascript. Javascript提供,可以&取消作为选项,而VBScript将为您提供是&".编号
请找到下面包含所有选项的链接,这些链接将为您提供帮助:警告,确认和提示 [ ^ ]



您可以尝试 jQuery modal-dialog或UI-confirm-dialog 并将其配置为yes-no选项.
参考:
如何创建jQuery确认对话框替换 [ ASP.NET jQuery UI确认对话框 [ ^ ]
ASP.NET JQuery确认对话框 [ ASP.NET确认框,其中包含使用modalpopup的是/否按钮选项 [^ ]
message box with yes no button
For this, you would need VBScript confirm instead of Javascript. Javascript gives, Ok & Cancel as options whereas VBScript will give you Yes & No.
Please find the link below that has all the options and will help you out: Alerts, Confirms and Prompts [^]

OR

you can try jQuery modal-dialog or UI-confirm-dialog and configure it for yes-no option.
Refer:
How to Create a jQuery Confirm Dialog Replacement[^]
ASP.NET jQuery UI confirm dialog [^]
ASP.NET JQuery Confirm Dialog[^]

OR

you can use Ajax ModalPopupExtender for it.
Refer: ASP.NET confirmation box with yes/no button options using modalpopup[^]


在按钮OnClientCLick上使用Javascript:

use Javascript for That on button OnClientCLick:

if(!confirm('Are you Sure to  do this Action?'))
 {
     return false;
 }



希望对您有帮助.



hope this will help you.


这篇关于在Asp.net中带有“是"没有按钮的消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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