Пример #1
0
 public string GetTitle(string ItemID,string NID,string Title)
 {
     string n = "";
     if (DataConverter.CLng(NID) == this.NodeID)
         n = "<a href=\"EditContent.aspx?GeneralID=" + ItemID + "\">" + Title + "</a>";
     else
     {
         B_Node bl = new B_Node();
         n = "<a href=\"EditContent.aspx?GeneralID=" + ItemID + "\"><strong>[" + bl.GetNode(DataConverter.CLng(NID)).NodeName + "]</strong>&nbsp;" + Title + "</a>";
     }
     return n;
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(base.Request.QueryString["NodeID"]))
            {
                int ItemID = DataConverter.CLng(base.Request.QueryString["NodeID"]);
                B_Node bnode = new B_Node();
                M_Node nodeinfo = bnode.GetNode(ItemID);
                if(nodeinfo.IsNull)
                    Response.Write("[产生错误的可能原因:您访问的内容信息不存在!]");
                string TemplateDir = "";
                if(string.IsNullOrEmpty(nodeinfo.IndexTemplate))
                    TemplateDir = nodeinfo.ListTemplateFile;
                else
                    TemplateDir = nodeinfo.IndexTemplate;

                if (string.IsNullOrEmpty(TemplateDir))
                {
                    Response.Write("[产生错误的可能原因:该节点未指定模板!]");
                }
                else
                {
                    TemplateDir = SiteConfig.SiteOption.TemplateDir + TemplateDir;
                    int Cpage = 1;
                    if (string.IsNullOrEmpty(base.Request.QueryString["page"]))
                    {
                        Cpage = 1;
                    }
                    else
                    {
                        Cpage = DataConverter.CLng(base.Request.QueryString["page"]);
                    }
                    TemplateDir = base.Request.PhysicalApplicationPath + TemplateDir;
                    TemplateDir = TemplateDir.Replace("/", @"\");
                    string ContentHtml = this.bll.CreateHtml(FileSystemObject.ReadFile(TemplateDir), Cpage, ItemID);
                    Response.Write(ContentHtml);
                }
            }
            else
            {
                Response.Write("[产生错误的可能原因:没有指定栏目ID]");
            }
        }