Reputation: 8477
I'm new to ASP.NET MVC and trying to determine the best approach for the following task. I have the following URLs that carry over from Web Forms application, that I want to continue to function by returning following paths in MVC:
Should I create a new Map Route or use URL Rewrite module? Please provide an example for the approach you advocate. The application is hosted in IIS 7.5 and uses ASP.NET 4.5 and MVC 4.0.
Upvotes: 1
Views: 2431
Reputation: 2493
I'm new too, but I will try to help you.
In App_Start/RouteConfig.cs
1
routes.MapRoute(
null,
"Default.aspx",
defaults: new { controller = "Default", action = "Index"},
);
2
routes.MapRoute(
null,
"about.aspx",
defaults: new { controller = "Default", action = "About"},
);
3
routes.MapRoute(
null,
"{keyword1}-{keyword2}-contact.aspx",
defaults: new { controller = "Default", action = "Contact"},
);
Upvotes: 1