Possible Duplicate:
Asp.Net MVC 2 - Bind a model's property to a different named value
Given following url:
~/mycontroller/myaction/?REG_NAME=123
following action:
public ActionResult MyAction(ActionRequest model)
and model:
public class ActionRequest
{
[ThisIsTheAttributeNameImLookingFor("REG_NAME")]
public string RegisteredTo { get; set;}
}
How can I map model's property (RegisteredTo) to url parameter (REG_NAME) with different name?
Inheriting CustomModelBinderAttribute is not the option, as it can not be applied to properties.