I have written below code to achieve URL Rewriting.
In Global.asax
routes.MapRoute(
"StudentDetail", // Route name
"StudentDetail", // URL with parameters
new { controller = "UDashboard", action = "UAboutMeStudentDetails",
SortField = UrlParameter.Optional }
);
In View
<a href="/StudentDetail?SortField='Major'" >Students</a>
When i click link, it goes to action of controller which is perfect.
But my URL is
https://localhost/StudentDetail?SortField='Major'
and i don't want that.
I just want my URL as
https://localhost/StudentDetail
What change should I do to achieve above URL?