BookShop.Web/Ajax/GetCateList.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace BookShop.Web.Ajax
{
    public partial class GetCateList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Response.Expires = 0;//清除缓存
            string result = string.Empty;
            result = GetAllCate();
            Response.Write(result);
            Response.End();
        }

        /// <summary>
        /// 获取所有的类别信息
        /// </summary>
        private string GetAllCate()
        {
            StringBuilder item = new StringBuilder();
            List<Model.Cate> list = CateBLL.GetCateList();
            foreach (Model.Cate cateInfo in list)
            {
                item.Append(",{id:" + cateInfo.CateID + ",pId:" + cateInfo.ParentID + ",name:'" + cateInfo.Name + "'}");
            }
            return "{id:0,pId:0,name:'所有类别'}" + item;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。