I think we have a dup of this in here but can't find it right now so porting it so we don't lose the bug.
https://aspnet.codeplex.com/workitem/10127
the model properties then the model is not created.
For example, If the model is:
public class AddressSearchModel
{
[Display(Name = "Name")]
public string BusinessName { get; set; }
[Display(Name = "Address")]
public string Address { get; set; }
}
and the controller method has the signature:
public JsonResult Find(AddressSearchModel address)
then "address" will always be null. However if I use something else as the parameter name:
public JsonResult Find(AddressSearchModel model)
then "model" will contain the object data. It appears there is a bug where the parameter name cannot match the name of the object property (most likely a reflection issue).
Comments: See http://aspnetwebstack.codeplex.com/workitem/904.
https://aspnet.codeplex.com/workitem/10127
the model properties then the model is not created.
For example, If the model is:
public class AddressSearchModel
{
[Display(Name = "Name")]
public string BusinessName { get; set; }
[Display(Name = "Address")]
public string Address { get; set; }
}
and the controller method has the signature:
public JsonResult Find(AddressSearchModel address)
then "address" will always be null. However if I use something else as the parameter name:
public JsonResult Find(AddressSearchModel model)
then "model" will contain the object data. It appears there is a bug where the parameter name cannot match the name of the object property (most likely a reflection issue).
Comments: See http://aspnetwebstack.codeplex.com/workitem/904.