title: Deserialize JSON string to c# object
body: <p>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.</p>
  
  <pre><code>var obj1 = new { arg1=1,arg2=2 };
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dbIZR.jpg" alt="enter image description here"></p>
  
  <p>After using the below code:</p>
  
  <pre><code>string str = "{\"Arg1\":\"Arg1Value\",\"Arg2\":\"Arg2Value\"}";
  JavaScriptSerializer serializer1 = new JavaScriptSerializer();
  object obje = serializer1.Deserialize&lt;object&gt;(str);
  </code></pre>
  
  <p>The object what i get i.e <strong>obje</strong> does not acts as obj1</p>
  
  <p><img src="https://i.stack.imgur.com/2g2RH.jpg" alt="enter image description here"></p>
  
  <p>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.</p>