ASP.NET 打开网页方法
C#在Asp.net中实现打开新网页而不关闭当前页
Respose.Write("<script language='javascript'>window.open('"+ url +"');</script>");
(打开简洁窗口):
Respose.Write("<script language='javascript'>window.open('" + url + "','','resizable=1,scrollbars=0,status=1,menubar=no,toolbar=no,location=no, menu=no');</script>");
1.Response.Redirect("XXX.aspx",true)——直接转向新的页面,原窗口被代替;
2. Response.Write("<script>window.open('XXX.aspx','_blank')</script>")——原窗口保留,另外新增一个新页面;
3.Response.Write("<script>window.location='XXX.aspx'</script>")——打开新的页面,原窗口被代替;
4.Server.Transfer("XXX.aspx")——打开新的页面;
5.Response.Write("<script>window.showModelessDialog('XXX.aspx')</script>")——原窗口保留,以对话框形式打开新窗口;
6.Response.Write("<script>window.showModelDialog('XXX.aspx')</script>")——对话框形式打开新窗口,原窗口被代替;
Respose.Write("<script
(打开简洁窗口):
Respose.Write("<script
1.Response.Redirect("XXX.aspx",true)——直接转向新的页面,原窗口被代替;
2. Response.Write("<script>window.open('XXX.aspx','_blank')</script>")——原窗口保留,另外新增一个新页面;
3.Response.Write("<script>window.location='XXX.aspx'</script>")——打开新的页面,原窗口被代替;
4.Server.Transfer("XXX.aspx")——打开新的页面;
5.Response.Write("<script>window.showModelessDialog('XXX.aspx')</script>")——原窗口保留,以对话框形式打开新窗口;
6.Response.Write("<script>window.showModelDialog('XXX.aspx')</script>")——对话框形式打开新窗口,原窗口被代替;