Exemplo n.º 1
0
        protected override void OnPreRender(EventArgs e)
        {
            int id = 1;

            int.TryParse(this.Request.QueryString["id"], out id);

            int page = 1;

            int.TryParse(this.Request.QueryString["page"], out page);

            if (id <= 0)
            {
                id = 1;
            }

            if (page <= 0)
            {
                page = 1;
            }


            string callBack = this.Request.QueryString["callBack"];

            if (string.IsNullOrEmpty(callBack))
            {
                return;
            }

            string lstString = JSON2.Serialize(GalleryHelper.GetPagedCategory(id, page, false));

            this.Response.Write(callBack + "(" + lstString + ")");
            this.Response.ContentType = "application/json";

            base.OnPreRender(e);
        }
Exemplo n.º 2
0
 public Request(string method, string uri, Hashtable data)
 {
     this.method     = method;
     this.uri        = new Uri(uri);
     this.byteStream = new MemoryStream(Encoding.UTF8.GetBytes(JSON2.JsonEncode(data)));
     this.AddHeader("Content-Type", "application/json");
 }
Exemplo n.º 3
0
        protected override void OnPreRender(EventArgs e)
        {
            string ids      = this.Request.QueryString["ids"];
            int    page     = Convert.ToInt32(this.Request.QueryString["page"]);
            string callBack = this.Request.QueryString["callBack"];

            if (string.IsNullOrEmpty(ids) || string.IsNullOrEmpty(callBack))
            {
                return;
            }

            string lstString = JSON2.Serialize(GetCategory(ids, page));

            this.Response.Write(callBack + "(" + lstString + ")");
            this.Response.ContentType = "application/json";

            base.OnPreRender(e);
        }