我想通过Response.Redirect("...")来达到跳转页面的目的,并且是在新窗口中打开页面。于是我就将此页面的form中target属性设置为_blank,然后使用Response.Redirect语句来实现跳转。可是出现了如下问题:点击后确实打开了一个新的窗口,但是这个窗口是空白的,什么内容也没有,而且这个窗口的地址不是所要跳转到的页面地址,而仍是原先页面的地址。请问这是为什么呢?如果解决?
调试欢乐多
this.Response.Write("<script>window.open('test.aspx','','')</script>");
你把代码贴上来看下吧!
可以Response.Write("<script language=javascript>window.open('url.aspx');</script>");")
if(IsPostBack)
{
Response.Redirect("...");
}
<form id="Form1" method="post" target="_blank" runat="server">
<asp:button id="Button1" runat="server" Text="Button"></asp:button>
</form>后台button1的click事件中写
response.redirect("xxxx.aspx")
完全可以打开新窗口连接到页面啊
<form id="Form1" method="post" target="_blank" action="xxx.aspx"> 注意了没有 runat="server"
<submit >的按钮
</form>
会在新窗口打开xxx.aspx
如果还要跳转的话.,可以在xxx.aspx里面写上调转的
1: 查毒 VISUAL STUDIO.NET 好想对病毒比较敏感,我机器经常出现一些摸名奇妙的问题,有时候提示什么不能进行DEBUG,有时候随便拖个控件运行后就出问题,查毒后基本上可以解决2: 重新装过FRAMWORK3: 看看你的机器是不是有什么PROXY的在搞鬼4: 弄一书包板砖去砸微软大楼,如果你用的是正版5: 如不是正版,那你就用那些砖头砸自己吧6: 没了
private Sub Button1_Click( s As Object, e As EventArgs )
Response.Redirect("blank.aspx?action=blank")
End Sub
</script>
<form id="Form1" method="post" target="_blank" runat="server">
<asp:button id="Button1" runat="server" Text="Button" onclick="Button1_Click"></asp:button>
</form>我这样试了,新出的窗体的内容并不会为空呀??试过了!
Response.Write("<Script>window.locattion.href=\"xxx.aspx\"</script>");
window.location.href="..."
能不能把具体的代码,怎样个页面说一下的?
在A中<HEAD>里加上<base target=_blank>