1
Answer

How to assign javascript array to model array in mvc4?

Hi,

I have a javascript array and i want to assign all its value to MVC Model array.

For ex.

var selectedValues = [];
$.each($('#ImageExtensionList option:selected'), function (index, value) {
selectedValues.push(value);

here, @Model.OptionList = selectedValues i want to assign but not working.

Can anyone share on this?

Thanks.

Answers (1)