I am attempting to extract data from a Json object in .NET MVC 4.
Here is a code snippet of my razor view:
var data = (function($)
{
var dataModel = @(new HtmlString(new
System.Web.Script.Serialization.JavaScriptSerializer()
.Serialize(Model)));
This won't run due the "@" sign within the javascript code.
How can I fix this so that razor switches back to .NET managed mode?
Thanks.