mercredi 29 novembre 2017

How to maintain asp.net mvc model binding on post to action method when there are many possible models

I have an asp.net mvc web page with drag and drop. Each item that can be dragged has its' own and different model. There will be hundreds of potential models and up to 2 can be dropped and posted to the action method at one time.

Currently I have one action method that has an input parameter of FormCollection because of the MANY potential models. Is there any way to have the input parameter the specific model instead of FormCollection? This is only a problem for me because there are potentially hundreds of different models. My current design will require me to manually map the fields, unless I can input the model(s).

Aucun commentaire:

Enregistrer un commentaire