I want to convert a Model property of type List to a Javascript variable usable in that same view. This is my model structure:
public string Title { get; set; }
public string Description { get; set; }
public List<String> ImgLinks { get; set; }
I want a Javascript array or json of the ImgLinks property of my model. I have tried-
var imageLinks = @(Html.Raw(Json.Encode(Model.ImgLinks)));
But i get a syntax error warning. Can anyone please help me out with the conversion to both javascript array and json?