Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int     rootID    = 0;
        Channel v         = new Channel();
        Channel condition = new Channel();

        if (!string.IsNullOrEmpty(this.Request["rootID"]))
        {
            rootID = Convert.ToInt32(Request["rootID"]);
        }
        string sn = RequestString.NoHTML(Convert.ToString(this.Request["sn"]));

        List <Channel> list = ChannelProvider.SelectByRootID(rootID);
        string         json = "{\"list\":[";

        for (int i = 0; i < list.Count; i++)
        {
            json += "{\"ID\":" + list[i].ID + ", \"name\":\"" + list[i].Name + "\", \"ParentID\":\"" + list[i].ParentID + "\", \"Depth\":\"" + list[i].Depth + "\", \"RootID\":\"" + list[i].RootID + "\",\"News\":" + GetNews(list[i].ID) + "},";
        }
        json  = json.Trim(',');
        json += "]}";
        Response.Write(json);
    }