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();
}
}
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
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".