开发者

MVC 3 - parse FormCollection to model

For my sample application I am building I am currently 开发者_JAVA技巧forced to pass a FormCollection object into my action method when attempting to do ajax updates on my view.

The reason I have chosen to pass FormCollection is that my view is rather complex and contains nested collections. If I were to Serialize and Json.Stringify it drops these nested collections when passed into my action method.

Is there a good technique to map my FormCollection object to an instance of my ViewModel once inside the controller ?

thanks


You can use TryUpdateModel<TypeOfYourModel>(YourModelInstance)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜