I am working ASP.Net MVC2 application. In that i have used URL Routing
To get URL as
https://localhost/StudentDetail/SortField
I have written below code in Global.asax
routes.MapRoute(
"StudentDetail", // Route name
"StudentDetail/{SortField}", // URL with parameters
new { controller = "UDashboard", action = "UAboutMeStudentDetails",
SortField = "Major" }
);
And In my view link is as below
<a href="/StudentDetail?SortField='Major'" >Students</a>
But it is not working. and my URL is
https://localhost/StudentDetail?SortField='Major'
Can anyone please help me to get the required URL..?
I want URL as
https://localhost/StudentDetail/SortField
Thanks In Advance, Prashant
<a href="/StudentDetail/Major" >Students</a>should work.