MVC basic knowledge-startup process (taking the near-Product source code as an example), mvc source code
This article takes v5.2 as an example to describe that the product is based on the asp.net mvc 5.0 framework. You can get to know more about the next version.
Near: http://www.jinhusns.com/
When the MVC project is started, it first enters the registration region, filter, BundleConfig, route, and a startup method starter encapsulated by the company to execute Application_Start () in Global)
Register the bundled CSS and JS files in BundleConfig. cs:
Bundles. Add (new StyleBundle ("~ /Bundle/Styles/Site "). Include ("~ /Css/bootstrap.css "));
Bundles. Add (new ScriptBundle ("~ /Bundles/easyui "). Include ("~ /Scripts/jquery. easyui. min-1.4.2.js "));
Usage in View:
@ Styles. Render ("~ /Bundle/Styles/Site ")
@ Scripts. Render ("~ /Bundles/easyui ")
FilterConfig. cs: registers external/Global filters. These filters can be applied to each Action and Controller.
Global Filter is effective for all action methods under all controllers of the application. The RegisterGlobalFilters method in the App_Start/FilterConfig. cs File
RouteConfig. cs: configure the system route path of the MVC application.