I am having a problem where everytime I post a form back to the [HttpPost]
version of my controller action, the ModelBinder returns a null object. I can\'t work
The problem is that there is a name collision between the property named Model
in the class DeviceModel
and the variable named model
in the Create
action. The name collision causes the DefaultModelBinder
to fail, since it tries to bind the Model property to the DeviceModel class.
Change the name of the variable in the Create action to deviceModel
and it will bind correctly.