Last Updated: February 25, 2016
·
1.132K
· mrantix

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