Session 注销

来源:互联网 发布:suse linux 安装yum源 编辑:程序博客网 时间:2024/04/27 18:22

<%@ Import Namespace="System.Web.Security " %>

  <script language="C#" runat=server>
    void Signout_Click(Object sender, EventArgs E) {

      FormsAuthentication.SignOut();
      Response.Redirect("login.aspx");
    }

 
</script>


若在框架中,则如下:

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import Namespace="System.Web.Security " %>
<%
     FormsAuthentication.SignOut();
%>

<script language="javascript">
     top.location.href="login.aspx";
</script>