简单注销用户控件

前台:

  
    
< 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 " );
}

 

你可能感兴趣的:(用户)