KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My Application is in Asp.Net MVC3 coded in C#. This is what my requirement is. I want an object which is in the following format.This object should be achieved when I deserialize the Json string. var obj1 = new { arg1=1,arg2=2 }; After using the below code: string str = "{\"Arg1\":\"Arg1Value\",\"Arg2\":\"Arg2Value\"}"; JavaScriptSerializer serializer1 = new JavaScriptSerializer(); object obje = serializer1.Deserialize<object>(str); The object what i get i.e obje does not acts as obj1 Here, in this example my JSON string is static, but actually JSON string is going to be dynamically generated runtime, so i won't be able get Arg1 and Arg2 all the time.
Tags (comma-separated)
Save Edits
Cancel