Its asp.net mvc paradigm. I have a Prices property on model that is an IList of type VMPrice. In view I do something like
<%var serializer = System.Web.Script.Serialization.JavaScriptSerializer();%>
<script type="text/javascript">
var prices = '<%:serializer.Serialize(Model.Prices)%>';
alert(prices);
prices = $.parseJSON(prices); // This line throws exception Invalid Json object
</script>
The alert call on fourth line shows following string
[{"SKUID":3,"ExFactoryPrice":765.00},{"SKUID":5,"ExFactoryPrice":39.91}]
What's the problem here and how to get around this?