yuanweisen

 

在C#中调用脚本的几种写法

ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "CheckName", "alert('词典名称不允许为空,请您填写');", true);    如果页面中含有updatePanel,用这种方式
 Response.Write("<script>alert('词典名称不允许为空,请您填写');</script>");   不说了,不太好用
 ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('词典名称不允许为空,请您填写')</script>");         现用方法,比较好用

RegisterStartupScript("", "<script type='text/javascript'>displays();</script>"); 调用JS文件里函数的方法

posted on 2008-11-24 15:50    阅读(683)  评论(0编辑  收藏  举报

导航