What is ASP. net mvc and its advantages

Source: Internet
Author: User
Tags what is asp

ASP. net mvc is relative to the traditional Form of ASP. NET Web Form. The MVC framework has a strong advantage, and WebForm is not useless. It is easier to develop in simple applications. The following briefly introduces ASP. net mvc.

What is ASP. net mvc?

Before learning about ASP. net mvc, you should first understand what MVC is. MVC is the abbreviation of Model-View-Controller, that is, Model-View-Controller. MVC is used to represent a software architecture Model. It divides the software system into three basic parts: Model), View) and Controller ). Model) generally refers to the "data Model", which is used to encapsulate data related to the application's business logic and to process the data. "Model" has the right to access data directly, such as accessing a database. "Model" does not depend on "View" and "controller", that is, the model does not care about how it is displayed or operated. View) is the UI Layer to display data. Controller) acts as an organizational unit between different layers and is used to control the process of an application. It processes events and responds.

ASP. net mvc provides a new Model-View-Controller MVC, Model-View-Controller) framework at the top layer of the existing ASP. NET 3.5 runtime. This allows developers to use the advantages of the MVC design pattern to create their own ASP.. NET Web application, which clearly separates the content display UI or View, business logic, and background data.. NET.

What is ASP. net mvc? What is the relationship between ASP. net mvc and ASP. NET Web Form?

ASP. net mvc is just another design pattern used to Develop ASP. NET applications. It does not replace ASP. NET Web Form pattern, but does not conflict with each other.

What are the advantages of ASP. net mvcasp. net mvc:

ViewState is no longer available: traditional ASP. NET WebForm mode uses ViewState to save the state information of the form. Due to the limitations of the B/S program, ViewState must store a large string in the hidden form field, this will greatly increase the number of page bytes, resulting in slow webpage loading;

Brief HTML: The final HTML code is completely controlled by the user, and no "junk code" is generated ";

Faster server-side processing and client rendering: MVC simply processes "templates" without building a complex control tree, and client rendering speed will be improved;

Only one model is required for multiple views: Sometimes the data to be displayed on a page is the same, but there are slight differences in the form. In this case, you only need to modify the view section, the existing controller behavior can be used;

Unit test: it is very difficult to test Webform. using MVC, you can split the business logic from the page and execute controllers in ASP. NET processes to facilitate testing.

  1. Differences between ASP. net mvc and WebForm
  2. ASP. net mvc unit test: confusing the Path attribute of the HttpContext class
  3. Custom ControllerFactory: interface implementation, supporting Area
  4. ASP. NET Routing
  5. Add custom routes for ASP. net mvc applications

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.