我用的是asp.net的C#语言,我是想WebForm2.aspx从到WebForm1.aspx
原来写的是(.aspx.cs)
private void Button1_Click(object sender, System.EventArgs e)
{

Response.Redirect("WebForm1.aspx");
}
可是我的按扭在(.aspx)是放在
<IFRAME src="WebForm3.aspx" name="3" scrolling="no" style="WIDTH: 752px; HEIGHT: 150px">
</IFRAME>
WebForm3.aspx里有
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
里的.当按的时侯只是在<IFRAME>里显示一块.
请大家帮助我想个办法.让WebForm2.aspx在新的浏览器内显示.或关了原来的在另一个浏览器显示.

解决方案 »

  1.   

    Response.Redirect("WebForm1.aspx");改为:Response.Write("<script>window.open('WebForm1.aspx','_blank')</script>");
      

  2.   

    private void Button1_Click(object sender, System.EventArgs e)
    {

    Response.Write("<script>parent.location.href='webform1.aspx';</script>");
    }
      

  3.   

    第2个参数解释:(注意要带引号)
    _blank 在新浏览器显示
    _Top 在当前整页显示
    _self 在当前显示(如上面情况就是在iframe里)
    _parent 在父框架显示(用于框架里面还有框架的情况)
    3  (这个3是你的iframe的name属性) 在你的iframe里显示
      

  4.   

    <a href="c.htm" target="_parent">??</a>
    <button onclick="parent.location.href='c.htm'">??</button>
    不要用服务器按钮