日期:2014-05-17  浏览次数:20408 次

关于top.window.location跳转的问题
ChangePWD.aspx在~/Main/ChangePWD.aspx
Login.aspx在~/Login.aspx

现通过ChangePWD.aspx修改密码成功后想返回login.aspx,代码如下,可是返回到的URL是~/Main/~/Login.aspx,请问各位大神哪里出了问题

C# code

Response.Write("<script>alert('修改成功!请使用新密码登陆!')</script>");
Session.RemoveAll();
Response.Write("<script>top.window.location = '~/Login.aspx'</script>");



------解决方案--------------------

Session.RemoveAll();
Response.Write("<script>alert('修改成功!请使用新密码登陆!');top.window.location = '" + Page.ResolveUrl("~") + "Login.aspx'</script>");