Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

how to convert namevaluecollection to json string


how to convert namevaluecollection to json string  using -'c#,.net,asp.net,json,namevaluecollection'

I tried:

  NameValueCollection Data = new NameValueCollection();
  Data.Add("foo","baa");
  string json = new JavaScriptSerializer().Serialize(Data);


it returns: ["foo"] I expected {"foo" : "baa"}
How do I to do this?
    

asked Oct 6, 2015 by abhi
0 votes
63 views



Related Hot Questions



Government Jobs Opening


...