title: Visual Studio Intellisense for JavaScript when generated from JavaScriptSerializer
body: <p>What is the correct way for getting JavaScript Intellisense in Visual Studio 2010 when creating a client side object with the <code>JavaScriptSerializer</code>?</p>
  
  <p>For example, I have a class named <code>Record</code> with several properties; I'm generating a collection of <code>Records</code> and then serializing them using the <code>JavaScriptSerializer</code>.</p>
  
  <p><strong>Code Behind</strong></p>
  
  <pre><code>public string JsonRecords
  {
      get
      {
          var js = new System.Web.Script.Serialization.JavaScriptSerializer();
          return js.Serialize( Records );
      }
  }
  </code></pre>
  
  <p><strong>ASPX page</strong></p>
  
  <pre><code>&lt;script&gt;
    // mocks the Record object
    var records = [{ "Date": "", "Latitude": 0, "Longitude": 0 }];
  
    // sets the Record object
    records = &lt;%= JsonRecords %&gt;;
  &lt;/script&gt;
  </code></pre>
  
  <p>When I pre-fill the JS records variable to mock the <code>Records</code> class, I get complete intellisense support with Visual Studio.</p>
  
  <p>This works, but it feels dirty. Is there a more appropriate method? Or is this a common practice?</p>