this.Page.ClientScript.RegisterStartupScript导致页面停顿,样式中的背景图片显示不全
2014-05-20 15:59
531 查看
之前错误的写法是:this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ss", "alert('请根据提示进行操作'); location.href= '" + A1.HRef + "';", true);
修改后的:this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ss", " document.body.onload=sload;function sload(){ location.href= '" + A1.HRef + "';}", true);
在项目中加“ document.body.onload=sload;”这句,让加载完成后调用此方法!
完美解决
修改后的:this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ss", " document.body.onload=sload;function sload(){ location.href= '" + A1.HRef + "';}", true);
在项目中加“ document.body.onload=sload;”这句,让加载完成后调用此方法!
完美解决
相关文章推荐
- response.write()刷新后影响页面排版,可用 this.Page.ClientScript.RegisterStartupScript
- C# Page.ClientScript.RegisterStartupScript(this.GetType(), "",js)不执行的原因
- Page.ClientScript.RegisterStartupScript(this.GetType(), "","")引号里面具体代表什么?
- ASP.NET先显示‘提示信息’然后再跳转---Page.ClientScript.RegisterStartupScript()
- this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.setInterval(timefresh, 1000);</script>");
- C# Page.ClientScript.RegisterStartupScript(this.GetType(), "",...
- ASP.NET AJAX 's UpdatePanel 中使用Page.ClientScript.RegisterStartupScript 失败
- Page.RegisterClientScriptBlock和Page.RegisterStartupScript有何区别?
- Page.ClientScript.RegisterStartupScript 与 Page.ClientScript.RegisterClientScriptBlock 之间的区别
- Page类中 RegisterStartupScript与RegisterClientScriptBlock的区别
- Page.RegisterClientScriptBlock和Page.RegisterStartupScript有何区别?
- Page.ClientScript.RegisterStartupScript() 方法与Page.ClientScript.RegisterClientScriptBlock() 方法
- Page.ClientScript.RegisterStartupScript() 方法与Page.ClientScript.RegisterClientScriptBlock() 方法
- 用Response.Write和Page.RegisterStartupScript显示的提示框有什么区别
- Page.RegisterClientScriptBlock(string, string)已过时:和page.RegisterStartupScript已过时:解决办法
- Page.ClientScript.RegisterStartupScript() 方法与Page.ClientScript.RegisterClientScriptBlock() 方法
- form没有标明runat="server"导致ClientScript.RegisterStartupScript没有效果
- Response.Write,Page.RegisterClientScriptBlock和Page.RegisterStartupScript的区别
- Page.RegisterClientScriptBlock和Page.RegisterStartupScript有何区别
- Page类中 RegisterStartupScript与RegisterClientScriptBlock的区别