Dictionary to Json object, "Expected expression"
- by MrW
I'm trying to convert a dictionery into a json object, so that I can work with it in my front end.
sortFields = <%= SchrodersHtmlHelper.ToJson(ViewData["SortInfo"])%>;
However, I keep on getting "Expected expression" for this all the time and I'm clueless why. Could anyone explain to me what I'm doing wrong?
Edit: The conversion works fine, but I still get this issue in the front end, causing the browser to complain about it.