I have just deployed my asp.net mvc-2 website to a server (using dotnetpanel). But getting this error
A default document is not configured for the requested
Have you add a default route to this class?
public class RouteConfig {
public static void RegisterRoutes (RouteCollection routes) {`
//"HomePage" is the root view of your app
routes.MapRoute (
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new {
controller = "Home", action = "HomePage", id = UrlParameter.Optional
}
);
}
}
` After that in Global.asax.cs add this line to Application_Start() method:
RouteConfig.RegisterRoutes (RouteTable.Routes);
I had this problem after I made an upgrade from MVC4 to MVC5 following this post and I had that line commented for a reason that I've forgot.
Hope this helps!