简单注销用户控件
时间:2010-10-20 来源:逃学书童
<asp:Button ID="btnLogout" runat="server" Text="注销" onclick="btnLogout_Click" />
后台:
protected void Page_Load(object sender, EventArgs e)
{
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
}
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Clear();
Response.Redirect("../Login.aspx");
}
相关阅读 更多 +