json formating in c# -


i tring xml data convert json. got issue.

        string xml = "<test><name>test class</name><x>100</x><y>200</y></test>";          xmldocument doc = new xmldocument();         doc.loadxml(xml);          return    newtonsoft.json.jsonconvert.serializexmlnode(doc); 

when display datavisualizer

{"test":{"name":"test class","x":"100","y":"200"}} 

but page return

"{\"test\":{\"name\":\"test class\",\"x\":\"100\",\"y\":\"200\"}}" 

it not valid json.

how format ?

what happening passing json string client, @ client if give datatype "json" again serialize string , above result.

fact not invalid json actually, need parse json object

at client side...using javascript

var jsonobject = json.parse("{\"test\":{\"name\":\"test class\",\"x\":\"100\",\"y\":\"200\"}}"); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -