Display formatted JSON in the view in ASP.NET MVC
An other way using Newtonsoft. Note the pre html tag is important to maintain the format.
<pre>
@Html.Raw(Newtonsoft.Json.Linq.JValue.Parse(Student.CreateEmpty()).ToString(Newtonsoft.Json.Formatting.Indented)
</pre>
You could use JSON.NET which supports to control the JSON format and indent it:
<pre>
@Html.Raw(JsonConvert.SerializeObject(Student.CreateEmpty(), Formatting.Indented))
</pre>