ASP. net mvc is an open-source MVC Framework officially provided by Microsoft. After a long preview and two RC versions, the official version 1.0 was released. Since Microsoft released the official version of ASP. net mvc Framework 1.0, the discussion of MVC has become endless.
Today, we have nothing to do with a complete example project based on a three-tier architecture MVC model application, open source code.
This project involves the following key points:
1) the entire solution is based on a standard three-tier structure.
2) The presentation layer adopts the MVC mode.
3) Data addition, deletion, modification, and query examples.
4) List data display and paging processing based on MVC.
5) applications of LINQ.
Create an MVC development environment:
. NET Framework 3.5 SP1:
Http://www.microsoft.com/downloads/details.aspx? Displaylang = ZH-CN & familyid = ab99342f-5d1a-413d-8319
-81da479ab0d7
Vs. net 2008 SP1:
Http://www.microsoft.com/downloads/details.aspx? Familyid = 27673c47-b3b5-4c67-bd99-
84e525b5ce61 & displaylang = ZH-CN
ASP. net mvc Framework 1.0 official version:
Http://www.microsoft.com/downloads/details.aspx? Familyid = 53289097-73ce-43bf-b6a6-
35e00103cb4b & displaylang = en
Microsoft MVC Official Website: http://www.asp.net/mvc/
Through learning MVC, we can see that MVC has the following features:
1) Separation of business processing and display: ASPX page and CSCodeCompletely separated. Better reuse and maintenance.
2) Form Controls on the server are no longer recommended. They are replaced by traditional input, or HTML. textbox is directly used to generate control labels.
3) No event-driven model is available. In ASP. net mvc, when a button is clicked, you should not habitually think that the corresponding Aspx. CS has
Click method. You should think of an action in a controller to handle this event.
4) No data binding is available. If you are used to the data binding of the gridview, you need to change your mind in ASP. net mvc.
5) added address rewriting. The MVC routing component allows us to perform URL routing well.
6) in general, we can understand that MVC is a web form-based programming model extension and a presentation layer programming model solution.
Download the full sample project source code for a layer-3 architecture-based MVC application: