I would like to know how can I use my ViewModel on the Create Action? I tried several examples I found here in the forum, but none solved my problem. I\'ve been racking my b
Similar to Erik Funkenbusch's answer I'd added a DropDownList to my form, however in my case it wasn't (and wasn't intended to be) submitted with the form as it was outside of the tags:
@Html.DropDownList("myField", Model.MyField)
As the Model contained the field for display only, this also caused the No parameterless constructor defined for this object
error because the field wasn't submitted at all.
In this case I fixed it by adding an exclude binding:
public ActionResult Foo(int id, int? page, [Bind(Exclude = "MyField")]MyModel model)