we currently have a big Webforms application thats currently running on 4.6 framework. We have the webforms routing already setup.
Now, we are trying to add MVC to this project and make it a hybrid application. But the problem comes when we try to use routing for both the Webforms as well as MVC views. Here is how
public static void RegisterRoutes(RouteCollection routes)
{
RouteTable.Routes.MapPageRoute("Test", "Test", "~/WebForm_Test.aspx");
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
I am unable to use it this way because it keeps using the webforms route for everything. i have read a lot of blogs(by Scott hanselman, etc) but none of them mention how to use routing in parallel.
When i remove the routing for the webforms and just the MVC routing and using the ASPX pages just by redirecting to "~/Webform_test.aspx" it seems to work fine.
can someone please help me setup routing for both webforms as well as MVC ?
Thanks