コード例 #1
0
        protected void Initialize()
        {
            bool   enableCache = (CDHelper.Config.EnableCache == "true");
            string result      = "";
            string curUrl      = Context.Request.Path.Replace('/', '_');

            result   = ChannelHelper.GetChannelIDFromURL();
            ColumnID = result;

            //初始化ArticleID
            result    = ArticleHelper.GetArticleIDFromURL();
            ArticleID = result;

            //初始化ColumnMode
            result     = GetColumnMode();
            ColumnMode = result;

            //初始化ThisChannel
            Channel ch = null;

            if (ColumnID != null && ColumnID != "")
            {
                ch = ChannelHelper.GetChannel(ColumnID, null);
            }
            else if (ColumnAlias != null)
            {
                ch = ChannelHelper.GetChannelByAlias(ColumnAlias);
            }
            else
            {
                ch = null;
            }

            ThisChannel = ch;
            //初始化TemplatePath
            result = TemplateHelper.GetThisPageTemplate(ColumnMode, ColumnID, SearchWord, SeSearchWord);
            if (result != null)
            {
                if (!result.StartsWith("/"))
                {
                    TemplatePath = "/" + result;
                }
                else
                {
                    TemplatePath = result;
                }
            }
        }