convert viewdata vector to string java script code example
Example: viewdata array mvc razor javascript
// For ASP.NET
var monthLists = @Html.Raw(Json.Encode(ViewData["months"]));
// For ASP.NET CORE
var monthLists = @Html.Raw(Json.Serialize(ViewData["months"]));