asp.net 2.0 的网站,登录检测成功后,用window.open打开一个新窗口跳转到登录后的页面,运行该项目能正确跳转到指定页面,但发布网站,新建一个虚拟目录指向发布的网站,却无法跳转到指定页面,而是跳转到登录页面,并把指定跳转的页面做为了ReturnUrl参数值。见下面登录跳转代码和登录前后的页面图片(主要看地址)
代码:
LoginResult result = AccountController.Login(userName, password);
if (result == LoginResult.Success)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("window.open('Framework/Framework.aspx','_blank','',true);");
sb.Append("window.opener = null;");
sb.Append("window.close();");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "LoginSuccess", sb.ToString(), true);
}
登录前:
登录后: