Reputation: 1557
I have a ASP.NET MVC3 Razor project. I wanted to add aspx page to this project and I found that it is possible by using MapPageRoute. I added it to my GlobalAsax.RegisterRoutes and it's redirecting me to my aspx page. But also most of the old pages are also redirected to this - they;re getting URL like this:
http://localhost:61000/AEM/Report?action=EditUser&controller=Settings
My RegisterRoutes method:
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute(
"TelerikReport",
"AEM/Report",
"~/WebForms/TelerikReport.aspx", true
);
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Account", action = "LogOn", id = UrlParameter.Optional } // Parameter defaults
}
What am I doing wrong here?
Edit: I noticed that it's redirecting pages wrong when I use "return RedirectToAction(...)" in my controllers.
Upvotes: 2
Views: 750