Its feature is introduced in MVC 5. In pursuance of that the "Route" attribute, we can define the URL structure. For instance, in the below code we have decorated the "GotoAbout" action with the route attribute. According to the route attribute that the "GotoAbout" can be invoked using the URL structure "Users/about".
public class HomeController : Controller
{
[Route("Users/about")]
public ActionResult GotoAbout()
{
return View();
}
}
Liked By
Write Answer
Explain attribute based routing in MVC?
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
15-Oct-2019Its feature is introduced in MVC 5. In pursuance of that the "Route" attribute, we can define the URL structure. For instance, in the below code we have decorated the "GotoAbout" action with the route attribute. According to the route attribute that the "GotoAbout" can be invoked using the URL structure "Users/about".