protected void Page_Load(object sender, EventArgs e) { string uid = Request.QueryString["uid"]; string cbk = Request.QueryString["callback"];//jsonp if (!string.IsNullOrEmpty(uid)) { DnFile db = new DnFile(); string json = db.all_complete(int.Parse(uid)); if (!string.IsNullOrEmpty(json)) { System.Diagnostics.Debug.WriteLine(json); json = HttpUtility.UrlEncode(json); //UrlEncode会将空格解析成+号 json = json.Replace("+", "%20"); Response.Write(cbk + "({\"value\":\"" + json + "\"})"); return; } } Response.Write(cbk + "({\"value\":null})"); }
protected void Page_Load(object sender, EventArgs e) { string uid = this.reqStringSafe("uid"); string cbk = this.reqStringSafe("callback");//jsonp if (!string.IsNullOrEmpty(uid)) { DBConfig cfg = new DBConfig(); DnFile db = cfg.downF(); string json = db.all_complete(int.Parse(uid)); if (!string.IsNullOrEmpty(json)) { System.Diagnostics.Debug.WriteLine(json); json = HttpUtility.UrlEncode(json); //UrlEncode会将空格解析成+号 json = json.Replace("+", "%20"); this.toContent(cbk + "({\"value\":\"" + json + "\"})", "application/json"); return; } } this.toContent(cbk + "({\"value\":null})", "application/json"); }