不使用Page.ClientScript.RegisterStartupScript()和ScriptManager.regist .....在asp.net c#中显示消息框。 [英] Not showing message box in asp.net c# using Page.ClientScript.RegisterStartupScript() and ScriptManager.regist..... .

查看:101
本文介绍了不使用Page.ClientScript.RegisterStartupScript()和ScriptManager.regist .....在asp.net c#中显示消息框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我使用这些脚本显示错误msg.Scripts调用proprly但msg没有在任何浏览器中显示..

这里是脚本..



 ClientScript.RegisterStartupScript(Page.GetType(),  fghh  alert('Check Min%data,Min1%+ Min2%+ Min3%+ Min4%必须等于100.'); true ); 

ScriptManager.RegisterStartupScript(txt_Min4_Per,Page.GetType(), alert('检查最小%数据,最小1%+最小2%+最小3%+最小4%必须等于100。'); true );



如何解决这个问题... 。

解决方案

试试这个

 ClientScript.RegisterStartupScript( typeof (页面),  MessagePopUp  alert('按摩'); true ); 


ScriptManager.RegisterClientScriptBlock(this,this.GetType(),VariableRegisteration,strScript,true);



如果在更新面板内验证


试试这个



 ScriptManager.RegisterStartupScript( this  this  .GetType(),  script  alert('Message'); true < /跨度>); 


hi I use these scripts for showing error msg.Scripts call proprly but msg not show in any browser..
here is scripts..

ClientScript.RegisterStartupScript(Page.GetType(), "fghh", "alert('Check Min% data, Min1% + Min2% + Min3% + Min4%  has to be equal to 100.');", true);

 ScriptManager.RegisterStartupScript(txt_Min4_Per, Page.GetType(), "", "alert('Check Min% data, Min1% + Min2% + Min3% + Min4%  has to be equal to 100.');", true);


how to solve this....

解决方案

try this

ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('Your Massage');", true);


ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "VariableRegisteration", strScript, true);

use this if ur validation inside update panel


Try this

ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Message');", true);


这篇关于不使用Page.ClientScript.RegisterStartupScript()和ScriptManager.regist .....在asp.net c#中显示消息框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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