This article provides an advanced overview of ASP. net mvc models, views, and controllers. In other words, it explains "M" "V" "C" in ASP. net mvc ". After reading this article, you should understand ASP.. Net MVC, you should also know how ASP. net MVC application and ASP.. NET web form applications.
ASP. NET MVC Applications Example
Use the default Visual Studio template to create ASP. net MVC web applications, a very simple instance program will be created along with, can be used to help understand ASP.. Net MVC program, this article will use this example to explain.
In Visual Studio 2008, click "file"> "create Project ", Select" ASP. net MVC "template to create an ASP.. Net MVC application, as shown in 1. In the Create Project dialog box, select a familiar programming language under the project type, such as Visual Basic or C #, and then select "ASP. net MVC Web Application Template, click OK.
Figure 1 create a project dialog box
You are creating a new ASP. net MVC application, a new unit test project creation dialog box is displayed, as shown in 2. This dialog box allows you to create a project for your solution to test your asp.. Net MVC application. Select "No, do not create a test project" here, and click "OK.
Figure 2 create a unit test dialog box
Create ASP. net MVC application, you will see Several folders and files in the solution browsing window. In particular, you will see the model, views, and controllers) three folders, as you have guessed from the names of these folders, include the model, view, and controller implementation files.
If you Expand Controller folder, you should see a name named homecontroller. VB file. If you expand the view folder, you will see two subfolders: Home and shared. If you expand the Hom folder, you will see two files: About. aspx and home. aspx (3 ). These files constitute an application created using the default ASP. net mvc template.