当前位置: 代码迷 >> ASP.NET >> this.Page.ClientScript.RegisterClientScriptBlock有关问题
  详细解决方案

this.Page.ClientScript.RegisterClientScriptBlock有关问题

热度:4854   发布时间:2013-02-25 00:00:00.0
this.Page.ClientScript.RegisterClientScriptBlock问题
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "<script type=text/javascript >alert(货品类型名称不能为空!')</script>");
为什么不能弹出窗口呢?

------解决方案--------------------------------------------------------
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", " <script type=text/javascript >alert('货品类型名称不能为空!'); </script>"); 

你少了单引号了.最好加上分号.

------解决方案--------------------------------------------------------
if(!this.Page.ClientScript.IsRegisterClientScriptBlockered("alert"))
{
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", " <script language='javascript' >alert(货品类型名称不能为空!') </script>"); 
}
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Sat Sep 22 00:01:53 CST 2018
  • 最近登录:Sat Sep 22 00:01:53 CST 2018
  • 最近登录:Sat Sep 22 00:01:53 CST 2018
  • 最近登录:Sat Sep 22 00:01:53 CST 2018
  • 最近登录:Sat Sep 22 00:01:53 CST 2018