title: Does the output of JsonConvert.SerializeObject need to be encoded in Razor view?
body: <p>I use the Newtonsoft library to convert C# objects into JSON. Is this use of <code>Newtonsoft.Json.JsonConvert.SerializeObject</code> secure, or is additional encoding necessary? If additional encoding is needed, what do you suggest?</p>
  
  <p>Here is how I use it in a Razor view:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var jsModel = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model))
  &lt;/script&gt;
  </code></pre>