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

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.

Figure 3 solution browsing window

By selecting the menu item "debug"> "start debugging", you can run this sample program. Similarly, press F5.

When you run ASP. net mvc for the first time Applications The dialog box shown in Figure 4 is displayed. We recommend that you enable the debugging mode and click OK to start running the program.

When you run an ASP. net mvc application, Visual Studio starts the application in your browser. The sample application consists of two pages: The index page and the about page. When the application is started for the first time, the index page is displayed (as shown in Figure 5). You can click the link in the upper-right corner of the application to switch to the about page.

Figure 4 "Debug not enabled" dialog box

Note the URL in the address bar of the browser. When you click the home link, the URL in the address bar of the browser changes to/home. When you click the about link, the URL is changed to/about.

If you close the browser and return to the Visual Studio window, you cannot see the home and about files exist. How can this problem be solved?

A URL is not equal to a page

When you build a traditional ASP. net web forms applications or ASP applications, a URL corresponds to a page, they are a one-to-one relationship, if you request a server named somepage. ASPX page, there is a file named somepage on the hard disk. aspx. If this file does not exist, a 404-page not found error will be returned.

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.