w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ASP.NET MVC4 - During an [HttpPost] Create, the object (model) that's passed in to Create(MyObj obj) is null for some reason

Try changing the name of the parameter in your ActionResult:

public ActionResult Create(Department dept) {
    ...
}

to

public ActionResult Create(Department department) {
    ...
}

The binding is getting confused with the dept parameter matching the name of the dept property on the model.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.