Why to studyASP. NET MVC?
The MVC architecture model was born in the year after the advent of the good loose coupling, ease of expansion, high maintainability and other advantages, re-fire in the development community. As Microsoft's new framework for Web site development,ASP. NET MVC provides a new development model that perfectly supports the classic MVC architecture model. provides a completely different development experience for. NET Engineers.
More and more companies and developers are starting to join the MVC development model, which has led him into a state of rapid development, and now MVC has become an ASP. NET is a common development model that allows you to learn a completely different architecture, so this is a development skill that we have reason and need to master.
ASP. NET MVCLearning Route
To have C #,ado,html,javascript,ASP. Net WebForm 's foundation
MvcIntroduction
MVC pattern two kinds of comprehension: one is the expression pattern, the other is the architecture pattern.
It divides the application into three main components, namely: ViewController (model)
M : Model is primarily a component that stores or processes data Model is actually to implement the business logic layer to the entity class corresponding database operations, such as:
CRUD (C:create/r:read/u:update/d:delete). It includes application information such as data, validation rules, data access, and business logic. ViewModel: View model
V:View is a user interface layer component. The main focus is to show the data in the Model to the user. ASPX and ASCX files are used to handle the responsibilities of the view.
C : Controller handles user interaction, from Model Data is obtained and passed to the specified View
MvcSchema Mode
MvcArchitecture Synthesis Model
asptwo ways to developWebFormthe way to develop
? Server-side controls
? General handler +html static page +ajax
? Generic handler +html template
ASP. NET MVCthe way to develop
? the release of the first open source project of the year
? More concise, closer to the original "request - process - Response"
? More development, more new features, community activity
? Will not replace WebForm
? The bottom is the same as the WebForm. Different treatments on the pipe.
WebForm VS MVC
ASP. NET MVCRequest Model
Mvcthe ConventionThe controller's convention is greater than the configuration
1.Controller is placed in the Controllers folder, and the naming method ends with a controller
2, each controller corresponds to a folder in the View, the folder name is the Same as the Controller name The method names in the Controller correspond to a view view (not required, but recommended) and The name of the view Action has the same name
3, the controller must be non-static class, and to implement the IController interface
4,Controller type can be placed in other projects.
Related conventions for views
1, All views must be placed in the view directory
2, different controller views are separated by folders, each controller corresponds to a view directory
3. The general view name corresponds to the Action of the controller (not required)
4, Multiple controllers public view put to shared
ASP. NET MVCadvantages of the model
Loosely coupled, easy to extend and maintain
Contribute to the Division of Labor in Development
Facilitates reuse of components
ASP. NET MVC better support Unit test
Better performance in team development mode
Introduction to ASP. NET MVC pattern