ASP. NET mvc3 Quick Start-Section 1 Overview

Source: Internet
Author: User
Address: http://blog.sina.com.cn/s/blog_6ad539a90100orxv.html

 

1.1  Content of this tutorial

   In this tutorial, you will learn the following:

    • Create an ASP. net mvc project.
    • Create an ASP. net mvc controller and view ).
    • How to Use the Entity Framework Code-first example to create a new database.
    • How to obtain and display data.
    • How to edit the data and verify the data validity.

 

1.2   Create a project

   If you want to create an ASP. net mvc3 project, first run Visual Web Developer 2010 Express ("Visual Web Developer" in this tutorial), and select "new project" on the start page ".
Visual Web Developer is an integrated development environment that you can use for various applications.ProgramDevelopment. There is a toolbar under the menu of Visual Web Developer. You can directly click each tool button in the toolbar to perform various operations, or you can directly click each menu item in the menu to perform various operations, click the "new project" menu item in the "file" menu.

Figure 1-1 Visual Web Developer 2010 ExpressStart page in

 

1.3   Create your first application 

   You can use Visual Basic or Visual C # As the development language to create an application. In this tutorial, select C # As the development language. Click the "new project" menu item. In the "new project" dialog box that opens, double-click "Visual C #" on the left to make it expand. Then, click "Web ", click "ASP. net MVC 3 web application, enter the name of the application in the name text box below, name it "mvcmovie" in this tutorial, and then click OK.

 

Figure1-2SelectASP. NET mvc3Application and name the application

 

   In the "new ASP. in the "net MVC 3 Project" dialog box, click "Internet application" and in the "view engine" drop-down box, keep the default "Razor" option unchanged (the razor view is ASP. net mvc3 is a very important new view type. Using it can make web application development more convenient and convenient, which will be described in detail later ).

Figure1-3Select a project template and view Engine 

   Click OK. Visual Web Developer provides a default template for the ASP. NET MVC project you created, so that you have an application that can be run immediately. The default template provides a simple display "Welcome to ASP. net mvc !" Text application, you can use this as your development start point.

Figure 1-4 Visual Web DeveloperProvides a default Application Template

   Click the "start debugging" menu item in the "debug" menu (the shortcut key for this menu item is F5). Visual Web Developer starts a built-in server, open the home page of the current web application on the server, as shown in figure 1-5.

Figure 1-5 debug screen of the default application template of ASP. NET mvc3

   Note that the address of the page in the browser is "http: // localhost: 4423 /". "Localhost" indicates the temporary website address of the web application you just created on the local machine, and "4423" indicates a random port used by visual web developer, visual Web developer uses this port as the port number of the built-in server. On each computer, the port number is different because it is randomly selected by visual web developer.
   In the upper-right corner of the template application page, two buttons are provided with a "login" link, click the "login" link, the page jumps to the login page, click the "home" button, return to the home page and click "about" to go to the "about" page.
   Next, let's begin to gradually change this default application to the application we want, and gradually learn about ASP. net mvc 3 in this process. First, let's close the browser and startCode.

 

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.