Learn ASP. net mvc (second) Practice

Source: Internet
Author: User

The previous article briefly understood the basic concepts and procedures of ASP. net mvc. The next few articles will show you how to create an application through ASP. net mvc through simple instances. The Demo is very simple and basic, and experts can bypass it.
If you have less time to talk about it, go to the topic. The first thing we need to do is install ASP. NET 1.0. You can download it from CodePlex.
Then we use VS2008Create a new ASP. net mvc Project:

After you click OK, You will be prompted to create a test project. Click OK.

In the solution, we can see the template created by ASP. net mvc for us:

By default:
Controls-place the Controller class to process URL requests.
Models-place the business entity class to represent and operate data.
Views-place the UI template file to display the output results.
Scripts-place Javascript class library files and. js files.
Contents-place CSS and image files, and other non-dynamic and non-Javascript files.
App_Data-place database files.
ASP. net mvc applications do not require such a directory structure. In fact, developers of large systems usually divide applications into multiple project files, which makes the project easier to manage (for example, the data Model class is usually in a separate class library project ). The default project structure provides a regular directory structure, which makes it clearer to save applications.
Directly run an existing project:

When we click log on:
Http: // localhost/: Port Number/{controller name}/{Action method name}

There is an Account Controller and a LogOn Action. In this way, the login page is requested:

  • Three pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • Next Page

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.