logout.cs

来自「完全网站系统」· CS 代码 · 共 86 行

CS
86
字号
namespace ASPNET.StarterKit.Communities {

    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using ASPNET.StarterKit.Communities;


    //*********************************************************************
    //
    // Logout Class
    //
    // Represents the user logout page which enables users to
    // signout from the community.
    //
    //*********************************************************************

    public class Logout : SkinnedCommunityControl {
    
        string _skinFileName = "Users_Logout.ascx";


        //*********************************************************************
        //
        // Logout Constructor
        //
        // Calls the base SkinnedCommunityControl constructor
        // and assigns the default page skin. Also calls Signout
        // method to signout the current user.
        //
        //*********************************************************************

		public Logout() : base() {
            // Assign a default skin file name
            if (SkinFileName == null)
                SkinFileName = _skinFileName;

            // Logout User
            UserUtility.SignOut();
        }

        
        //*********************************************************************
        //
        // SkinType Property
        //
        // Specifies the skins directory where this page's skin file is located.
        //
        //*********************************************************************
        
        override protected string SkinType {
            get { return "ContentSkins"; }
        }


        //*********************************************************************
        //
        // OnLoad Method
        //
        // We need to redirect back to the same page to clear the authentication ticket.
        //
        //*********************************************************************

        override protected void OnLoad(EventArgs e) {
            if (Context.Request.QueryString["logout"] == null)
                Context.Response.Redirect("users_logout.aspx?logout=true");
        }
        


        //*********************************************************************
        //
        // InitializeSkin Method
        //
        // This method is required by the SkinnedCommunityControl class.
        // It does nothing here.
        //
        //*********************************************************************

        override protected void InitializeSkin(Control skin) {} 
        


    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?