Tina's blog
开心过好每一天! Come on !

  protected override void OnLoad(EventArgs e)
    {
        #region MasterPage_Handler
        if (!string.IsNullOrEmpty(this.MasterPageFile))
        {
            string orgMasterPageFile = this.MasterPageFile;
            HtmlLink link;
            if (orgMasterPageFile.ToLower().IndexOf("myappmaster.master") >= 0)
            {
                link = new HtmlLink();
                link.Href = "../style/mainframe.css";
                link.Attributes["rel"] = "stylesheet";
                link.Attributes["type"] = "text/css";
                this.Page.Header.Controls.Add(link);
            }
            if (orgMasterPageFile.ToLower().IndexOf("mysettingsmaster.master") >= 0)
            {
                link = new HtmlLink();
                link.Href = "../style/TblAlignSetting.css";
                link.Attributes["rel"] = "stylesheet";
                link.Attributes["type"] = "text/css";
                this.Page.Header.Controls.Add(link);
            }
            if (orgMasterPageFile.ToLower().IndexOf("ordinarymaster.master") >= 0)
            {
                link = new HtmlLink();
                link.Href = "../style/TblAlignSetting.css";
                link.Attributes["rel"] = "stylesheet";
                link.Attributes["type"] = "text/css";
                this.Page.Header.Controls.Add(link);
            }
            //OrdinaryMaster
        }
        #endregion

        if (!this.Page.IsPostBack)
        {

            this.Page.DataBind();
        }
        base.OnLoad(e);
    }

posted on 2008-08-12 15:56  Tinachang  阅读(296)  评论(1编辑  收藏  举报