原设置为:
1、web.config:
  <authentication mode="Forms">
      <forms name="form" loginUrl="login.aspx" path="/" protection="All" timeout="20"/>
    </authentication>
...
  <authorization>
    <deny  users="?"  />
  </authorization>  ...
2、login.aspx...
System.Web.Security.FormsAuthentication.RedirectFromLoginPage("TextBox1.Text",false);
Response.Redirect("default.aspx");
...##################################现在想要把 跳转 改为 打开窗口,即把 “Response.Redirect("default.aspx");” 改为=====
Response.Write("<script language='javascript'>");
Response.Write("window.open('default.aspx','main','top=5,left=5,width=780,resizable=yes,height=300,menubar=no,toolbar=no,scrollbars=yes,status=no');");
Response.Write("</script>");====结果发现没有打开default.aspx窗口,还停留在login.aspx窗口,请问如何解决?
由于是新手,对.net还不了解,上面的一些设置都是从网上找来的,不是很明白,请简单讲一下原理,为什么会出现这种情况,不胜感激!

解决方案 »

  1.   

    Response.Write("</script>");
    后面跟一个Response.End();后面不能有Response.Redirect 语句否则失效
      

  2.   

    Response.Redirect("default.aspx");就不要了 
    直接访问其它页面就行,如未验证login.aspx就会出来
      

  3.   

    Response.Write("<script language='javascript'>window.open('default.aspx');</script>");
      

  4.   

    大家好像没明白我的意思,我现在已经把“Response.Redirect("default.aspx");”这条语句换成“Response ...”打开窗口的语句了,可是不好用。
      

  5.   

    把 “Response.Redirect("default.aspx");” 改为
    Response.Write("<Script>window.onload=function(){window.open('default.aspx','main','top=5,left=5,width=780,resizable=yes,height=300,menubar=no,toolbar=no,scrollbars=yes,status=no');window.opener=null;window.close();};</script>");
      

  6.   

    把 
    “Response.Redirect("default.aspx");” 
    改为
    Response.Write("<Script>window.onload=function(){window.open('default.aspx','main','top=5,left=5,width=780,resizable=yes,height=300,menubar=no,toolbar=no,scrollbars=yes,status=no');window.opener=null;window.close();};</script>");
    这样就行我一前遇到过
      

  7.   

    你先把 改为
    <authorization>
        <deny  users="*"  />
      </authorization>  只写这一句 式式
    Response.Write("<script language='javascript'>window.open('default.aspx');</script>");
      

  8.   

    我也试了goody9807()的方法,还是不好用,我觉得是在打开窗口时丢失了用户验证信息,所以没有打开窗口却回到了login.aspx页面,可是将<deny  users="*"  />也不好用,真是费解?
      

  9.   

    楼上的方法就行了。asp.net会自己调用login.asp页面
    你在webconfig中配置好后
      

  10.   

    我的意思是 不考虑验证 直接写
    Response.Write("<script language='javascript'>window.open('default.aspx');</script>");
    看看行吗
      

  11.   

    我遇到过斑竹的问题,困扰了我很长时间也没有解决,用Response.Redirect("...")可以打开网页,而用window.open("...")则不行.与form验证的下面的语句有关System.Web.Security.FormsAuthentication.RedirectFromLoginPage("TextBox1.Text",false);
    如果取消上述语句.则window.open("...")就可行.不知何原因.
      

  12.   

    不考虑验证 直接写
    Response.Write("<script language='javascript'>window.open('default.aspx');</script>");
    是可以打开窗口,不过还是login.aspx页面,而不是default.aspx页面
      

  13.   

    string tmp="";
    tmp="<script language='javascript'>window.open('default.aspx');</script>";
    Page.RegisterStartupScript("confirm", tmp);try it again!