htmlpage.cs

来自「非常不错的学校在线考试分析系统」· CS 代码 · 共 88 行

CS
88
字号
namespace ASPNET.StarterKit.Communities.HtmlPage {
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web;
    using ASPNET.StarterKit.Communities;


    //*********************************************************************
    //
    // HtmlPage Class
    //
    // Represents an HTML page.  
    //
    //*********************************************************************

    public class HtmlPage : SkinnedCommunityControl {
    
        string _skinFileName = "HtmlPage_HtmlPage.ascx";
        
        Literal ltlHtml;

        
        //*********************************************************************
        //
        // HtmlPage Constructor
        //
        // Calls the base SkinnedCommunityControl constructor
        // and assigns the default page skin.
        //
        //*********************************************************************

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


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


        //*********************************************************************
        //
        // InitializeSkin Method
        //
        // Retrieves all the controls from the Page Skin
        //
        //*********************************************************************

        override protected void InitializeSkin(Control skin) {
            // Find HTML Literal
            ltlHtml = (Literal)GetControl(skin, "ltlHtml");
			ltlHtml.EnableViewState = false;
		}


        //*********************************************************************
        //
        // OnLoad Method
        //
        // Retrieves HTML page from HtmlPageUtility component
        // and displays the page.
        //
        //*********************************************************************

        override protected void OnLoad(EventArgs e) {
            if (!Page.IsPostBack) {
                EnsureChildControls();
                ltlHtml.Text = HtmlPageUtility.GetHtmlPage(objSectionInfo.ID);
            }
        }

            

    }
}

⌨️ 快捷键说明

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