- Specify a Name for a Route
- By using that Name, you can easily allow URI generation for it
- Well,It's like this : [Route("Booking", Name = "Payments")]
BookingController.cs
public class BookingController : Controller
}
public class BookingController : Controller
{
// eg: /Booking
[Route("Booking", Name = "Payments")]
public ActionResult Payments() { return View(); }
- After that you can generate a Link is using Url.RouteUrl
- It's like this :