【发布时间】:2011-11-17 10:18:08
【问题描述】:
我在谷歌上搜索了很多这个。我得到了所有代码,但该代码不起作用。我创建了一个注销按钮,并在按钮的单击上将用户重定向到注销页面......但进一步的事情并不顺利。
这是登出页面的代码
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.Clear();
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
string redirectUrl = FormsAuthentication.LoginUrl + "?ReturnUrl=loginAcc.aspx";
FormsAuthentication.SignOut();
Response.Redirect(redirectUrl);
}
编辑:出现以下异常:找不到资源。
描述:HTTP 404。您要查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请查看以下 URL 并确保其拼写正确。请求网址:/MailFormat/login.aspx
【问题讨论】:
-
您能否详细说明进一步的事情?
-
“其他事情进展不顺利”?具体是什么问题?
-
“进一步的事情不顺利”具体是什么意思?
-
发生以下异常 ===== 找不到资源。说明:HTTP 404。您要查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请查看以下 URL 并确保其拼写正确。请求的 URL:/MailFormat/login.aspx