Skip to content
Advertisement

Build a view model for c# using jQuery

I have one view model and i’m pass that view model into controller, but one of the model property is a list of other class. so i’m not able to bind it via jQuery.

I have the following view model.

JavaScript

ToolsParamsBlockViewModel class that is used as list type

JavaScript

here is my controller method that handle viewmodel data

JavaScript

and finally im trying to add data into viewmodel using jQuery, here it is. im use table for add list into Params_List property.

JavaScript

here in ParamsList have array of table row elements but i need it into view model format. thanks in advance

Advertisement

Answer

thanks phuzi its work for me 🙂

here I have changed some code block.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement