0

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

4

have you tried

@Html.Raw(output)

?

answered Feb 6, 2012 at 22:00

2 Comments

Thanks, that worked! SO not allowing me mark an answer so quickly. Will do it.
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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.