<summary>///http://james.newtonking.com/json/help/index.html# (Geovin Du) 20141228///Jebsen Office///</summary> public partial class _default:system.web.ui.page {Geovindu_timelineprojectinfo Geovindu_timelineprojectinfo = new Geovindu_timelineprojectinfo (); GEOVINDU_TIMELINEPROJECTBLL GEOVINDU_TIMELINEPROJECTBLL = new GEOVINDU_TIMELINEPROJECTBLL (); Geovindu_timelineassetinfo geovindu_timelineassetprojectinfo = new Geovindu_timelineassetinfo (); list<geovindu_timelinedatainfo> selectgeovindu_timelinedataproject = new List<geovindu_timelinedatainfo > (); Geovindu_timelinedatainfo geovindu_timelinedatainfo = new Geovindu_timelinedatainfo (); Geovindu_timelineassetinfo geovindu_timelineassetdatainfo = new Geovindu_timelineassetinfo (); GEOVINDU_TIMELINEASSETBLL GEOVINDU_TIMELINEASSETBLL = new GEOVINDU_TIMELINEASSETBLL (); GEOVINDU_TIMELINEDATABLL GEOVINDU_TIMELINEDATABLL = new GeovinDU_TIMELINEDATABLL (); <summary>/////</summary>/<param name= "sender" ></param>// /<param name= "E" ></param> protected void Page_Load (object sender, EventArgs e) {try {geovindu_timelineprojectinfo = Geovindu_timelineprojectbll.selectgeovindu_timelineproject (1); Geovindu_timelineassetprojectinfo = Geovindu_timelineassetbll.selectgeovindu_timelineassetproject (1); Selectgeovindu_timelinedataproject = Geovindu_timelinedatabll.selectgeovindu_timelinedataproject (1); for (int i = 0; i < Selectgeovindu_timelinedataproject.count; i++) {Selectgeo Vindu_timelinedataproject[i]. Timelinedataassetinfo = Geovindu_timelineassetbll.selectgeovindu_timelineassetdata (selectGeovindu_ Timelinedataproject[i]. Timedataid); }//context. Response.ContentType = "Text/plain"; Context. Response.Write ("Hello World"); Geovindu_timelineprojectinfo = Geovindu_timelineprojectbll.selectgeovindu_timelineproject (1); Geovindu_timelineassetprojectinfo = Geovindu_timelineassetbll.selectgeovindu_timelineassetproject (1); Selectgeovindu_timelinedataproject = Geovindu_timelinedatabll.selectgeovindu_timelinedataproject (1); for (int i = 0; i < Selectgeovindu_timelinedataproject.count; i++) {selectgeovindu_t Imelinedataproject[i]. Timelinedataassetinfo = Geovindu_timelineassetbll.selectgeovindu_timelineassetdata (selectGeovindu_ Timelinedataproject[i]. Timedataid); } jobject RSS = new Jobject (New Jproperty ("timeline", New Jobject (New Jproperty ("headline", Geovindu_timelineprojectinfo.timeheadline), New Jproperty ("type", GeovindU_timelineprojectinfo.timetype), New Jproperty ("text", Geovindu_timelineprojectinfo.timetext), New Jproperty ("StartDate", Geovindu_TimeLineProjectInfo.TimeStartDate.ToString ("Yyyy,mm,dd")), New Jproperty ("Asset", New Jobject ( New Jproperty ("Media", Geovindu_timelineassetprojectinfo.timeassetmedia), new Jproperty ("credit", Geovindu_timelineassetprojectinfo.timeassetcredit), New Jproperty ( "caption", Geovindu_timelineassetprojectinfo.timeassetcaption)), New Jproperty ("date") , from P in Selectgeovindu_timelinedataproject order By P.timedataheadline Select New Jobject (New JP Roperty ("StartDate", p.tImedatastartdate.tostring ("Yyyy,mm,dd")), New Jproperty ("headline", P.TIMEDATAHEADL INE), New Jproperty ("text", P.timedatatext), New Jproperty ("Asset", New Jobject (//g Eovindu_timelineassetdatainfo=geovindu_timelineassetbll.selectgeovindu_timelineassetdata (P.TimeDataID) New Jproperty ("Media", P.timelinedataassetinfo.timeassetmedia), New Jproperty ("credit", P.timelinedataassetinfo.timeassetcredit), New Jproperty ("caption", P.timelinedataassetinfo.timeassetcaption) ))))))); Response.Write (RSS. ToString ()); File.writealltext (Server.MapPath ("Geovindu.json"), RSS. ToString ()); } catch (Exception ex) {Response.Write (ex. Message.tostring ()); } } }}
Csharp:learn How to post JSON string to generic Handler using JQuery in ASP C #.