ASP. net mvc Tutorial: understanding models, views, and controllers (1)

Source: Internet
Author: User
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.

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.