本文介绍了如何从代码隐藏调用javascript:confirm()警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想从codebehind(C#)调用Confirm Alert message并获取OK&的值.取消按钮(在确认警报消息按钮上),

Hello All,

I want to called Confirm alert message from codebehind(C#) and get value of OK & cancel button(on confirm alert message button),

if(userclick ==true)
{
do further ...
}
else
{
 ....
}


请建议我,我该如何实现?


please suggest me ,how can i achieve this?

推荐答案

Button1.Attributes.Add("onclick", "javascript:return " + "confirm('your messege ')");


string msg1;
       msg1 = "<script language='javascript'>alert('Are You Sure You Want To Delete Madhuri s Data !');</script>";
       if (!ClientScript.IsStartupScriptRegistered("error"))
           {
               RegisterStartupScript("error", msg1);
           }


string msg1;
        msg1 = "<script language='javascript'>confirm('are You sure you want to delete Madhuri s data ...!');</script>";
        if (!ClientScript.IsStartupScriptRegistered("error"))
        {
            RegisterStartupScript("error", msg1);
        }


这将给您确认....
不,不,对不起...


this will give you confirm....
No thnx No sorry...


这篇关于如何从代码隐藏调用javascript:confirm()警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 02:11