shashi
shashi

Reputation: 4696

Getting Bad Json output when using a View in MVC

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?

Upvotes: 0

Views: 420

Answers (1)

Mike Simmons
Mike Simmons

Reputation: 1298

have you tried

@Html.Raw(output)

?

Upvotes: 4

Related Questions