title: vb.net web api $.ajax response not json object
body: <p>Attempting a simple web api call in vb.NET that returns json so that the jQuery ajax response is already a javascript object.  Just can't seem to get it working.</p>
  
  <pre><code>' GET api/&lt;controller&gt;
  Public Function GetValues()
      Dim json As New Dictionary(Of String, String)
      json.Add("status", "success")
      json.Add("msg", "good job")
  
      Dim serializer = New JavaScriptSerializer()
      Return serializer.Serialize(json)
  
      'Return JsonConvert.SerializeObject(json)
  End Function
  </code></pre>
  
  <p>Ajax call:</p>
  
  <pre><code>$.ajax({
      url: "api/products",
      type: 'GET',
      contentType: "application/json; charset=utf-8",
      data: JSON.stringify({key:'key'}),
      dataType: 'json',
      success: function (response) {
          console.log(response);  // prints {"status":"success","msg":"good job"}
          console.log(response.status);  // prints undefined
      }
  });
  </code></pre>
  
  <p>Chrome shows:<br /> 
  Request header: Content-Type:application/json; charset=utf-8<br />
  Response header: Content-Type:application/json; charset=utf-8<br />
  Network/Response tab shows:  "{\"status\":\"success\",\"msg\":\"good job\"}"</p>
  
  <p>It's obviously not being turned into a javascript object automatically but I can't figure out why.  Doesn't matter if I return the response from JavaScriptSerialize.Serialize() or NewtonSofts JsonConvert.SerializeObject.</p>
  
  <p>I must be missing something fundamental here.  Can anyone point me in the right direction?</p>