当前位置: 代码迷 >> 综合 >> Page.ClientScript.RegisterStartScript用法
  详细解决方案

Page.ClientScript.RegisterStartScript用法

热度:54   发布时间:2023-12-27 15:51:13.0

asp.net中Page.ClientScript.RegisterStartupScript用法小结

asp.net中PageClientScriptRegisterStartupScript用法小结,有需要的朋友可以参考下。

//ASP.NET后台页面跳转Page.ClientScriptRegisterStartupScript(Page.GetType(),"","<script>if(confirm('保存成功!是否继续添加?')){location href='product.aspx';}else{location.href='productlist.aspx'}</script>");//后台弹出确定框ClientScript.RegisterStartupScript(GetType(),"message","<script>alert('请正确输入!')</script>");//ASP.NET后台页面跳转Page.ClientScriptRegisterStartupScript(Page.GetType(),"<script>alert('数据添加成功!');{location href='product.aspx';}</script>");或Page.ClientScriptRegisterStartupScript(typeof(string),"","<script>window.location.href='adminmain.aspx';</script>";//后台弹出文本框ScriptManager.RegisterStartupScript(Page.typeof(string),"popUp","window.open('rptview.aspx','打印预览',toolbar=no,location=no,scrollbars=yes,top=200pt,width=904px,height=650px),true);

  相关解决方案