Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the default page in mvc3?

I am not certain how a domain can load a test when there is no default document like default.aspx in root. Is in the "global.asax" ? where is the default page in mvc3?

like image 762
motevalizadeh Avatar asked Dec 16 '22 07:12

motevalizadeh


1 Answers

You're gonna find that in Views/Home/

The index page

Mvc works through the controller - model - view model

When you create a default project you will find that the global.asax has the following code:

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );

This means that the Default page is the Index action in the Home controller.

You can access other pages by this example: If you have an AccountController with a Login view, it means you can access the login page by going to /Account/Login.

like image 88
Lauw Avatar answered Jan 03 '23 02:01

Lauw