Csharp:learn How to post JSON string to generic Handler using JQuery in ASP C #.

Source: Internet
Author: User

 <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 #.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.