ASP.NET后台页面跳转

 //ASP.NET后台页面跳转 
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", 
"<script>if(confirm('保存成功!是否继续添加?')){location.href='ProductonAdd.aspx'}
else{location.href='ProductonList.aspx'}</script>");

//后台弹出确定框
ClientScript.RegisterStartupScript(GetType(), 
"message", "<script>alert('请正确输入!');
</script>");

//ASP.NET后台页面跳转
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('数据添加成功!');
{location.href='ProductonList.aspx'}
</script>");
或
Page.ClientScript.RegisterStartupScript(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=200px,left=200px,width=904px,height=650px')",
 true);



 StringBuilder script = new StringBuilder().Append("
<script language=\"javascript\"    type=\"text/javascript\">\n")
    .Append(" setTimeout(\"alert('" + msg + "')\",100);\n")//延长一秒,确保其他数据加载完成 /                
    .Append("</script>\n");
Page page = HttpContext.Current.CurrentHandler as Page;
 page.ClientScript.RegisterStartupScript(
 page.GetType(), "1", script.ToString());

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页