title: Ajax error Object object in dotnet when returning an Json
body: <p>i got an ajax call on an cshtml file:</p>
  <pre><code>        $.ajax({
              url: `@Url.Action(&quot;LoadChartData&quot;, &quot;Sensor&quot;)`,
              dataType: &quot;json&quot;,
              type: &quot;get&quot;,
              async: &quot;false&quot;,
              data: &quot;plaindata&quot;,
              contentType: 'application/json; charset=utf-8',
              success: function (d){
                  $.each(d, function(index, item){
                      data.addRows([item.tag, item.value]);
                  });
              },
              error: function(xhr){
                  alert(&quot;Error &quot; + xhr);
              }
          });
  </code></pre>
  <p>In the LoadCharData method, i reed an file from an txt and convert this to Json to return</p>
  <pre><code>        public JsonResult LoadChartData()
          {
              List&lt;ChartData&gt; items = new List&lt;ChartData&gt;();
  
              using (StreamReader r = new StreamReader(&quot;./Data/ChartData.txt&quot;))
              {
                  string json = r.ReadToEnd();
                  items = JsonConvert.DeserializeObject&lt;List&lt;ChartData&gt;&gt;(json);
              }
  
              return Json(new {data = items});
          }
  </code></pre>
  <p>When i go to the rote, the ajax returns an error Object object. I dont know how to inspect this or check the value.
  If i send an request to the JsonResult method using insominia, the data returns perfect.
  Can anyone help me? Thanks</p>