An introduction to "ASP" MVC

Source: Internet
Author: User

Describe

This article focuses on ASP. NET MVC, which includes the following:

1.MVC Mode Overview

2.WebForm Overview

3.WebForm and MVC Differences

4.asp.net MVC Development History

5. Application Structure

6.asp.net MVC Default Conventions

An overview of the MVC pattern

1. MVC Pattern Application Areas

Analysis:

(1) Currently, MVC is widely used as a mainstream framework, such as Java Web Development,. NET asp,net MVC

(2) MVC pattern is widely used in middleware, such as RABBITMQ;

(3) MVC pattern is widely used in interface development, such as ASP. WebAPI;

(4) Other areas;

Overview of the 2.MVC approximate process

Analysis:

(1) MVC consists of three core modules: Controllers (Controller, abbreviation C), models (model, abbreviation m), and Views (view, abbreviated as V);

(2) View is responsible for rendering, model is responsible for data processing, controller is responsible for dealing with the logic between view and model;

(3) In WebForm, it is generally ui+bll+dal+utility+webservice mode, whereas in MVC, Soa+webapi+dal+model+mq+aop+docker mode is generally used;

Two WebForm overview

1. WebForm Life cycle

Analysis:

(1) WebForm page life cycle is essentially the application of several methods;

(2) Focus on understanding the pipeline;

(3) When analyzing the page life cycle, we should combine the HTTP essence to synthesize the analysis.

2.WebForm Request Response Process Overview

Analysis:

(1). In WebForm, resources can be divided into static and dynamic resources:

Static resources: JS files, images files, CSS files and HTML files, etc.;

Dynamic resources:. Aspx,.ashx,.ascx, etc.;

(2). In WebForm, the browser issues a resource request to IIS, and when IIS receives the request URL, it first determines whether the request is a dynamic resource request or a static resource request, and then goes to the server to search for resources in different modes.

3. Webfrom page composition

Analysis:

(1) WebForm, each page corresponds to a class, page tears inherit the pages class, we call the page class, such as the Default page in the corresponding class is _default,

(2) each page consists of three parts: front-end code (default.aspx), background code (Default.aspx.cs) and designer (Default.aspx.designer.cs);

The difference between three WebForm and MVC

1.WebForm is not conducive to the separation of front and rear end, MVC separation;

2. The request URL is different, in general, the WebForm request is the specific path resource on the server (of course you can configure virtual road), but MVC is not so (according to the routing rules, the general case is:/controller/view);

3. Comparison with MVC, response time (due to server-side controls, time-consuming servers) and bandwidth issues (WebForm will have a lot of junk data, such as ViewState)

(4) In WebForm, it is generally ui+bll+dal+utility+webservice mode, whereas in MVC, Soa+webapi+dal+model+mq+aop+docker mode is generally used;

Four-Net-ASP MVC development History

Five application program structure

Analysis:

(1) in the ASP. NET Web framework, the directory structure can be extended and modified.

Automatically generated directory structure based on the MVC framework:

However, in the actual project practice, the general need to adjust, the revised directory structure is as follows:

"Empty template", adding "unit test"

The default build structure is as follows

Traditional three-storey structure:

Based on SOA architecture

Of course, in the UI layer, the general situation is to partition the

Six aps.net MVC Scaffolding conventions

Analysis:

MVC based on ASP. NET MVC scaffolding, some default conventions, such as the controller must end with Cotroller, and so on, these default conventions, do not need to be configured in the Web. config configuration file;

Seven ASP. b/S Scaffolding contains templates

Analysis:

1..NET is divided into C/s and b/s,b/s scaffolding contains templates for Webform,mvc,webapi,single Page application,azure API application;

Eight other content

Routing, controllers, views, models, forms and HTML-assisted methods, data annotations and validation, membership, authorization and security, NUGET,WEBAPI, Dependency injection, Unit testing, MVC advanced topics will be shared with you in subsequent articles.

Nine reference documents

"01" ASP. MVC5 Advanced Programming (Jon Galloway,brad Wilson,k.scott allen,david Matson, Sun translation)

"02" MSDN

Ten copyright areas

    • Thank you for your reading, if there are shortcomings, welcome advice, common learning and common progress.
    • Bo main website: http://www.cnblogs.com/wangjiming/.
    • A very small number of articles using reading, reference, reference, copying, copying and pasting into a variety of ways, most of the original.
    • If you like, please recommend, if you have new ideas, welcome, email: [Email protected].
    • The blog can be reproduced, but must be well-known from the blog source.

An introduction to "ASP" MVC

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.