确认Java脚本中的msg框. [英] Confirm msg box in java script.

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

问题描述



在我的应用程序中,我使用的是javascript函数中的确认消息框,在显示确认消息框控件之前,导航至文件后面的代码,并在处理函数确认消息框后面的代码之后.此Java脚本函数在用户控件中使用.


如果您有任何解决方案,请告诉我们.

谢谢.

Hi,

In my application i am using confirm message box in javascript function,Before displaying confirm message box control navigate to code behind file and after processing code behind function confirm message box display.This java script function use in user control.


Please let us know if you have any solution on it.

Thanks.

推荐答案

亲爱的,

按钮单击事件中尝试以下代码

hi dear,

try below code in your button click event

private void button_Click(object sender, System.EventArgs e)
{
    string jScriptValidator;
    jScriptValidator="<script> function ReqFieldValidator()" + 
                " { if (document.forms[0].txtField.value == '') \n"; 
    jScriptValidator+="{ alert('Replace your logic insted of this alert box') \n ";
    jScriptValidator+="return false; \n";
    jScriptValidator+="} \n";
    jScriptValidator+=" return true \n";
    jScriptValidator+=" } </script>";
    Page.RegisterStartupScript("regJSval",jScriptValidator);
    this.Form.Attributes.Add("onLoad","return ReqFieldValidator()");
}


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

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