Beispiel #1
0
        /// <summary>
        /// 没有子栏目
        /// </summary>
        /// <param name="ParentID"></param>
        public void LoadParent(long ParentID)
        {
            StringBuilder strMenu  = new StringBuilder(1000);
            StringBuilder strChild = new StringBuilder(200);

            DataTable dt = WebInfoLogic.ParentCategoryID(ParentID);

            if (dt.Rows.Count > 0)
            {
                DataTable dtname = WebInfoLogic.ParentNameByID(ConvertHelper.ConvertLong(dt.Rows[0][0].ToString()));
                if (dtname.Rows.Count > 0)
                {
                    //strMenu.Append(string.Format("<div class=\"list_li\" style=\"cursor:pointer\"><a href=\"InfoList.aspx?InfoCategoryID={0}\">{1}",

                    //                  dt.Rows[0][0].ToString(), dtname.Rows[0][0].ToString()) + "</a></div>");

                    strMenu.Append(string.Format("<div class=\"list_li\" style=\"cursor:pointer\">{0}",

                                                 dtname.Rows[0][0].ToString()) + "</div>");

                    DataTable dtChild = WebInfoLogic.ParentNameByID(ParentID);
                    if (dtChild.Rows.Count > 0)
                    {
                        strChild.Append(string.Format("<ul class=\"list_ul00\">"));
                        strChild.Append(string.Format("<li class=\"list_ul00_li\"><a href=\"Info.aspx?InfoCategoryID={0}\" target=\"_self\">{1}</a></li>", ParentID.ToString(), dtChild.Rows[0][0].ToString()));
                        strChild.Append("</ul>");
                    }
                }
            }
            leftName.InnerHtml = strMenu.Append(strChild.ToString()).ToString();
        }