情况:index.aspx 中有个iframe(login.aspx),login.aspx页面有2个ascx控件,在其中一个ascx控件中跳到index.aspx
在ascx.cs中使用了很多种的刷新页面的方法都失败了,最后尝试下面的方法,终于成功了.
1.location.reload()使用后会一直重复刷新页面
2.window.location.reload(); window.opener.location.reload(); parent.document.location.reload();只能刷新到login.aspx
3.最后偶然发现通过再加一个history.go(-1);window.location.reload;就可以跳到index.aspx
Response.Write("<script> alert('登录成功!');parent.document.location.reload(); history.go(-1);window.location.reload;</script>");