So I have the following route in my RouteConfig.cs
routes.MapRoute(
name: "Student",
url: "student",
defaults: new { controller = "Home", action = "Student", id = UrlParameter.Optional }
);
Based on this route, I have the following method in my Home
controller:
public ActionResult Student()
{
return View();
}
This simple route when invoked http://localhost:54326/student
will take me to the Student view. All good till now.
How can I achieve this route: http://localhost:54326/student/01-28-2021
when I invoke the above route automatically?
Basically, I want to append a string at the end of the original route when it is invoked.
Is there anything I can specify in RouteConfig
through which I can achieve this?