我正在try 将一个对象作为JSON写入我的Asp.Net MVC视图使用Razor,如下所示:
<script type="text/javascript">
var potentialAttendees = @Json.Encode(Model.PotentialAttendees);
</script>
The problem is that in the output the JSON is encoded, and my browser doesn't like it. For example:
<script type="text/javascript">
var potentialAttendees = [{"Name":"Samuel Jack"},];
</script>
如何让Razor发出未编码的JSON?