title: MVC View - JSON not parsing correctly from controller
body: <p>I am unable to understand why my JSON is not parsing correctly.  I am parsing a c# dictionary to a JSON string in my controller. The output is correct there.  When I pass the string back to my partial view, it does not render properly, and I am getting "Unexpected Token &amp;" Ive tried it multilple ways in returning it to the view, but to no avail.  </p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>    var data = @Model.JSONDict
      //data output - var data = {&amp;quot;3/1/2014&amp;quot;:2,&amp;quot;2/28/2014&amp;quot;:1,&amp;quot;2/27/2014&amp;quot;:1,&amp;quot;2/26/2014&amp;quot;:0,&amp;quot;2/25/2014&amp;quot;:0,&amp;quot;2/24/2014&amp;quot;:0,&amp;quot;2/23/2014&amp;quot;:0}
  
  
      //var keys = Object.keys(data);
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>string output = JsonConvert.SerializeObject(dict);
  
  //Resulting Output = "{\"3/1/2014\":2,\"2/28/2014\":1,\"2/27/2014\":1,\"2/26/2014\":0,\"2/25/2014\":0,\"2/24/2014\":0,\"2/23/2014\":0}"
  
              ViewData["allEntries"] = output;
              model.JSONDict = output;
  
              return PartialView("_Graph", model);
  </code></pre>
  
  <p>I have also tried parsing out the &amp; acocording to this post: <a href="https://stackoverflow.com/questions/19010622/cannot-get-data-in-a-view-after-parsing-json-data-from-controller-in-asp-net-mvc">Cannot get data in a view after parsing json data from controller in asp.net mvc</a> like so, but getting the same error message: </p>
  
  <pre><code>storejson= getJSonObject("@ViewBag.JsonData");
  
  function getJSonObject(value) {
      return $.parseJSON(value.replace(/&amp;quot;/ig, '"'));
  }
  </code></pre>