I am using this library to help with implementing a few visualizations using Google Chart api.
The problem is that the json that I am getting as output has & quot; in the json instead of "
Below is part of the response I am getting.
{"cols": [{"id": "Year", "label": "Year", "type": "number"}, {"id": "Month", "label": "Month", "type": "number"}, {"id":
i am using .NET4, ASp.NET MVC3 and outputting this as a view. The code of the view is as below.
@{
Layout = null;
string output = new Bortosky.Google.Visualization.GoogleDataTable((System.Data.DataTable)ViewData["ResultDataTable"]).GetJson();
}
@output
I suspect the issue is happening because I am not outputting the string in the view properly.
Any ideas what am I doing wrong?
asked Feb 6, 2012 at 21:57
1 Answer 1
have you tried
@Html.Raw(output)
?
answered Feb 6, 2012 at 22:00
2 Comments
shashi
Thanks, that worked! SO not allowing me mark an answer so quickly. Will do it.
Mike Simmons
cool :) - that worked because mvc html encodes text rendered to the page by default to protect us from script injection - to override it you need to output raw text, which is that Html.Raw() does
lang-cs