100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
.NET Framework

Project Structure in ASP.NET MVC

How a typical ASP.NET MVC project is organized on disk - the Models, Views, and Controllers folders, App_Start configuration, and supporting conventions.

FoundationsBeginner7 min readJul 10, 2026
Analogies

Project Structure in ASP.NET MVC

A default ASP.NET MVC project (created via File > New Project > ASP.NET Web Application) scaffolds a predictable folder layout: /Controllers, /Models, /Views, /Scripts, /Content, and /App_Start, plus a Global.asax entry point. This convention-over-configuration approach means the framework can locate controllers, views, and startup configuration automatically as long as you follow the naming and folder conventions, minimizing the boilerplate wiring you'd otherwise need.

🏏

Cricket analogy: A default MVC project's folder layout is like a cricket academy's standard facility blueprint - nets, pitch, and pavilion always in predictable places - so any coach joining knows exactly where to find equipment without a tour.

The Controllers, Models, and Views Folders

The /Controllers folder holds C# classes whose names end in 'Controller' (e.g., HomeController.cs), and MVC's controller factory discovers them by convention without any manual registration. /Models holds domain and view-model classes, and /Views contains one subfolder per controller (e.g., /Views/Home/) plus a /Views/Shared folder for cross-cutting templates like _Layout.cshtml, Error.cshtml, and _ViewStart.cshtml.

🏏

Cricket analogy: MVC discovering HomeController.cs by its name ending in 'Controller' is like a scorer automatically filing a player's stats under their registered team name, no manual sorting required.

App_Start: Bootstrapping the Application

The /App_Start folder centralizes startup configuration in dedicated static classes: RouteConfig.cs registers URL routing patterns, BundleConfig.cs configures CSS/JS bundling and minification, FilterConfig.cs registers global action filters like HandleErrorAttribute, and these are all invoked from Application_Start() in Global.asax.cs when the app first boots.

🏏

Cricket analogy: Application_Start() invoking RouteConfig and FilterConfig is like a team's pre-match routine - warm-up, team-sheet submission, pitch inspection - all run in sequence before the umpire calls play.

csharp
protected void Application_Start()
{
    AreaRegistration.RegisterAllAreas();
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
}

public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }
}

Static Content and Areas

Static assets like CSS, JavaScript, and images live in /Content and /Scripts (or wwwroot in newer templates), served directly by IIS/Kestrel without going through the MVC pipeline, while larger applications use Areas - self-contained mini-MVC structures under /Areas/{AreaName}/ with their own Controllers, Models, and Views folders - to organize distinct functional modules like Admin or Blog.

🏏

Cricket analogy: Static images served directly from /Content bypassing MVC's pipeline is like ground staff replacing sightscreens without needing umpire approval - a background task independent of the actual match logic.

Areas require their own AreaRegistration class (e.g., AdminAreaRegistration.cs) registered via AreaRegistration.RegisterAllAreas() in Global.asax, and their routes must include an {area} route value to avoid colliding with the default route.

  • Default project structure: /Controllers, /Models, /Views, /Scripts, /Content, /App_Start.
  • Controllers are discovered by naming convention (class names ending in 'Controller').
  • /Views/Shared holds cross-cutting templates like _Layout.cshtml and Error.cshtml.
  • App_Start classes (RouteConfig, BundleConfig, FilterConfig) centralize startup configuration.
  • Application_Start() in Global.asax.cs invokes all App_Start registration methods.
  • Static assets in /Content and /Scripts bypass the MVC pipeline entirely.
  • Areas let large applications organize self-contained modules with their own MVC folder structure.

Practice what you learned

Was this page helpful?

Topics covered

#NETFramework#ASPNETMVCStudyNotes#MicrosoftTechnologies#ProjectStructureInASPNETMVC#Project#Structure#ASP#NET#StudyNotes#SkillVeris