首页 > Linux操作系统 > Linux操作系统 > .net中 使用脚本
方法1:用于UpdatePanel中:
System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('OK');", true);
方法2:在已呈现的页的顶部添加一个脚本块。
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "sec", "
方法3:背景不是空白.RegisterStartupScript. 方法添加的脚本块在页面加载完成但页面的 OnLoad 事件引发之前执行。
ClientScriptManager cs = Page.ClientScript;
cs.RegisterStartupScript(this.GetType(), "NoFile", "
方法4:
Response.Write("");
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-545376/ ,如需转载,请注明出处,否则将追究法律责任。