⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 categorydisplay.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;

using CommunityServer.Blogs.Components;
using CommunityServer.Components;

namespace CommunityServer.Blogs.Controls
{
    /// <summary>
    /// Summary description for CategoryDisplay.
    /// </summary>
    public class CategoryDisplay : WeblogThemedControl
    {
        public CategoryDisplay()
        {
		
        }

        /// <summary>
        /// Attaches controls need to display category data
        /// </summary>
        protected override void AttachChildControls()
        {
            Literal title = FindControl( "Title" ) as Literal;
            Literal body = FindControl( "body" ) as Literal;
            HyperLink rss = FindControl( "rss" ) as HyperLink;

            int CategoryID = 0;
            if(Context.Request.QueryString["CategoryID"] != null)
            {
                double cid = 0;
                if(Double.TryParse( Context.Request.QueryString["CategoryID"], System.Globalization.NumberStyles.Integer, null, out cid ))
                    CategoryID = (int)cid;
            }

            if(CategoryID >=0)
            {
                CategoryType ct = (CategoryType)Enum.Parse(typeof(CategoryType),Context.Request.QueryString["CT"],true);
                PostCategory pc = PostCategories.GetCategory(CategoryID,ct,this.CurrentWeblog.SectionID,false);
                if(pc != null)
                {
                    if(title != null)
                        title.Text = pc.Name;
                    
                    if(body != null)
                        body.Text = pc.Description;

                    if(rss != null)
                    {
                        rss.Visible = ct == CategoryType.BlogPost;
                        if(rss.Visible)
                            rss.NavigateUrl = BlogUrls.Instance().Rss(this.CurrentWeblog.ApplicationKey,CategoryID);
                    }

                    this.SetPageTitle(pc.Name);
                }

            }
        }

    }
}

⌨️ 快捷键说明

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