Search code examples
asp.netasp.net-mvcattributerouting

What is optional parameter "Name" of MVC 5 Attribute Routing


In the attribute routing feature of MVC5 there is a option in attribute routing syntax for "Name" parameter e.g : [Route("Register/SetPassword", Name="SetPasswordGet")]

My question is what is this "Name="SetPasswordGet" parameter ? and how to use it?


Solution

  • You can use the name as the parameter in the RedirectToRoute() method, see msdn and this question