I am developing a web application with ASP.NET MVC. I have a problem with the route.
I need such a route.
http: //localhost/content-name/23.html
I defined a route for this as follows
//i need this route but it not work
routes.MapRoute(
"GetContent",
"{sefLink}/{contentId}.html",
new { controller = "Content", action = "GetContent" },
new[] { "CanEcomm.Controllers" });
But the route does not work. IIS shows me 404 pages. When I remove the .html extension so that the route works.
//this route is working. i just remove ".html" extension
routes.MapRoute(
"GetContent",
"{sefLink}/{contentId}",
new { controller = "Content", action = "GetContent" },
new[] { "CanEcomm.Controllers" });
How can i solve this? thank you
source
share