MVC3 - Model Property Name and Action Parameter Name - Fight!
If you have a model with a property which is the same name as your action parameter name, the model binder will not bind and you model is blank
public class MyModel{
public string Model { get; set; }
}
public ActionResult Update(MyModel model) { }
This is one gotcha I won't be caught by again
Written by Anthony Johnston
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Model binding
Authors
mrantix
1.258K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#