MVC basic knowledge-startup process (taking the near-Product source code as an example), mvc source code

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.