1
$(document).ready(function () { 
    var imgs = @Model.EditProductImageList.ToArray();
    console.log(imgs); 
});
0

1 Answer 1

2

With the following you can serialize your object into a json and this can be parsed into an array with javascript

So your in your page/view would look like this:

<script type="text/javascript">
    var json = '@Json.Serialize(Model.EditProductImageList)';
    var array = JSON.parse(json);
</script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.