1、在aspx.cs后台Response.Write()跳转路径,打开新窗口

时间:2021-09-24 19:27:25

1、Response.Write()打开新窗口

Response.Write(" <script type='text/JavaScript'>window.open('" + url + "','_blank'); </script>");

2、asp.net打开新窗口的多种方法

.Response.Redirect("XXX.aspx",true)——直接转向新的页面,原窗口被代替;
. Response.Write("<script>window.open(XXX.aspx'',''_blank'')</script>")——原窗口保留,另外新增一个新页面;
.Response.Write("<script>window.location=XXX.aspx''</script>")——打开新的页面,原窗口被代替;
.Server.Transfer("XXX.aspx")——打开新的页面;
.Response.Write("<script>window.showModelessDialog(XXX.aspx'')</script>")——原窗口保留,以对话框形式打开新窗口;
.Response.Write("<script>window.showModalDialog(XXX.aspx'')</script>")——对话框形式打开新窗口,原窗口被代替;