我做了一个登录页面login.aspx,上面的登录按钮事件如下protected void Button1_Click(object sender, EventArgs e)
{
string uid = "kw";
string logName = TextBox1.Text;
string logpassword = TextBox2.Text;
keewit.BLL.LoginBLL loginbll = new keewit.BLL.LoginBLL();
if (loginbll.getLoginOn(uid, logName, logpassword))//如果登录验证通过
{
HttpCookie authCookie = FormsAuthentication.GetAuthCookie(logName, true);
HttpContext.Current.Response.Cookies.Add(authCookie);
Page.RegisterStartupScript("", "<script>openWindow('mainframe.htm','mainwin','1024','768')</script>");//在此打打一个新的窗口(fullscreen=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1)
}
}在打开的mainframe.htm(框架)TOP 页(top.apsx)有一个logout按钮
事件如下protected void Button1_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
}web.config: <authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".keewit"></forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>当我在点top.aspx的logout按钮时,mainframe的TOP会将页面导航到登录页面,此时,我在login.aspx页面上点一下刷新,然后提示“不重新发送信息,则不刷新网页。点击重试再次发送信息,点击取消回到查看的网页”。我点重试后,注意,此时页面的登录名和密码都没有填写,但刷新后一样导航到了mainframe,且显示是正常的登录,请问这是怎么回事,如何解决。谢谢!!
再有,怎么样才能做到当我点击login页面的登录按钮时,打开mainframe后,关闭login页面,谢谢!!!
{
string uid = "kw";
string logName = TextBox1.Text;
string logpassword = TextBox2.Text;
keewit.BLL.LoginBLL loginbll = new keewit.BLL.LoginBLL();
if (loginbll.getLoginOn(uid, logName, logpassword))//如果登录验证通过
{
HttpCookie authCookie = FormsAuthentication.GetAuthCookie(logName, true);
HttpContext.Current.Response.Cookies.Add(authCookie);
Page.RegisterStartupScript("", "<script>openWindow('mainframe.htm','mainwin','1024','768')</script>");//在此打打一个新的窗口(fullscreen=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1)
}
}在打开的mainframe.htm(框架)TOP 页(top.apsx)有一个logout按钮
事件如下protected void Button1_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
}web.config: <authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".keewit"></forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>当我在点top.aspx的logout按钮时,mainframe的TOP会将页面导航到登录页面,此时,我在login.aspx页面上点一下刷新,然后提示“不重新发送信息,则不刷新网页。点击重试再次发送信息,点击取消回到查看的网页”。我点重试后,注意,此时页面的登录名和密码都没有填写,但刷新后一样导航到了mainframe,且显示是正常的登录,请问这是怎么回事,如何解决。谢谢!!
再有,怎么样才能做到当我点击login页面的登录按钮时,打开mainframe后,关闭login页面,谢谢!!!
window.opener.window.opener = null;
window.opener.window.close();
清除所有COOKIEHttpContext.Current.Response.Cookies.Clear();
2、清除所有cookid这样写不行,还会出出我前面提到的刷新就出来的问题
if (window != top)
top.location.href = window.location.href;
</script>