c# - Deserialize complex JSON object using ASP.NET? -


I have successfully created a code that serializes a complex javascript object and posts it on the ASP.Net page. I can get JSON string using Request.Form and results (I add indentation for readability) looks like this:

  { "gasterPerStolPerVecka": { "name": "gasterPerStolPerVecka", "keyValue_id": "2", "set_id": "1", "containerElement": "#gasterPerStolPerVecka", "keyValueComponents": [{ "name": "GasterPerStolPerVecka_guestsPerWeek", "value": "200" }, { "name": "GasterPerStolPerVecka_numberOfChairs", "value": "100"}], "keyValueUnitText": "Gaster / stol per Vecka", "KeyValueCalculationMethod": "division", "if": true, " results ": 2}," tillgangligaStolstimmarPerVecka ": {" name ":" tillgangligaStolstimmarPerVecka "," keyValue_id ":" 1 "," set_id ":" 1 "," containerElement ":" #tillgangligaStolstimmar True, "result": 3500}, "" "", "value": "value": "value": "value": "35"}, {"name": "multiplication", "if there is" planeradIntaktPerTillgangligStolOchVecka ": {" name ":" PlaneradIntaktPerTillgangligStolOchVecka "," KeyValue_id "" "" Set_id "" "" ContainerElement ":", "value", "value": "", "" value ":" "," "Planrdayntktpr Tilgangligstolocvika_anmberof Chair", "value": "100"}], "Kiva lueUnitText": "kr", "keyValueCalculationMethod": "division", "if": false, "results": null, "ErrorText" ". "{Name}:" "planeradIntaktPerTillgangligaStolstimmar", "keyveralitimetPerTillgangligaStolstimmar", "keyValue_id": "" set_id ":" "containerElement": "#planeradIntaktPerTillgangligaStolstimmar", "keyValueComponents": [{"name" "PlaneradIntaktPerTillgangligaStolstimmar_weeklyRevenue", "value": "", "" Money ":" value ":" 100 "}]," Key Valuinttait "," value ":" "," "," Planerad indent Prt Tilganglagastolistmmar_pen Hiyrrspiyr "," Value ":" 35 "}, {" name ":" Tillgangalgastolstimmer_number of chairs at PlannerIDctore ":" KR "," Key Valuulation Method ":" Divide_diva E "," Aisaiaidiaidiaidi "wrong" results ": null," error text ":" The official notification. " }}  

Now I try to distribute it on server side, but it is difficult. I'm getting error:

[NullReferenceException: Object reference not set to an instance of an object.]

Where do not know me To start looking for errors?

Thanks in advance! / Thomas Khn

to Strag instead serialization


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -