我在带有剃刀的 asp.net mvc 3 中。该模型是类型IList<PipeLineView>
。的定义PipeLineView
是
public class PipeLineView
{
public string Stage { get; set; }
public decimal Amount { get; set; }
public string Color { get; set; }
public int Count { get; set; }
public int LevelNo { get; set; }
}
在视图中我正在做类似的事情
JavaScriptSerializer serializer = new JavaScriptSerializer();
var data = serializer.Serialize(Model);
在我的javascript中
<script type="text/javascript">
var data =JSON.parse(@Html.Raw(data));
</script>
当我在Firefox中加载页面时,出现以下js错误
SyntaxError: JSON.parse: unexpected character
[Break On This Error]
...":5,"LevelNo":1},{"Stage":"Level2","Amount":0.000,"Color":"Red","Count":0,"Level...
这里可能是什么问题?谢谢