The "main page" is nothing more than arbitrary Actionin the concrete Controller, which returns a certainView
To set the Home page, a page or better articulated on the default page, you need to change the routing information in the file Global.asax.cs:
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
AreaRegistration.RegisterAllAreas();
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "NotHome", action = "NotIndex", id = "" }
);
Pay attention to the definition of the route:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "NotHome", action = "NotIndex", id = "" }
);
This route is a "caught" route, that is, it will take any URL and break it into a specific controller, action and identifier. If none or one of the routes is defined, it will use the default values:
new { controller = "NotHome", action = "NotIndex", id = "" }
: " - , , NotIndex NotHome". "", , "Default.aspx", "Index.html" MVC.