I am working on a Web Forms Web Application with mixed in MVC. I have followed the instructions from this page http://www.packtpub.com/article/mixing-aspnet-webforms-and-aspnet-mvc and it works fine in VS2010 developer server but when I try to publish it to a MVC enabled IIS 6 browser is not automatically redirect to default.aspx after login and I get a 404 error at the root of the application.
My Global.asax.cs looks like this:
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
}
If I comment out the call to RegisterRoutes in Application_Start method the automatic redirect to default.aspx works but then the MVC parts fail.
I need some help with how to setup the routing to enable automatic redirect to default.aspx while enabling the MVC routing. The MVC parts is located under a specific path like so: myserver/applicationname/mvcparts.
Asp.Net MVC 3 is installed on both developer machine and server where I publish.