ASP. NET mvc4 Getting Started Guide (1): getting started

Source: Internet
Author: User

This tutorial describes how to use Microsoft Visual Studio express 2012 or visual web developer 2010 Express Service Pack 1 to create an ASP. NET mvc4 web application.ProgramThe basic knowledge required. We recommend that you use Visual Studio 2012. You do not need to install any components to complete this tutorial. If you are using Visual Studio 2010, you must install the following components. You can click the following link to install all required components:

    • Visual Studio Web Developer express SP1 prerequisites
    • WPI installer for ASP. net mvc 4
    • Localdb
    • Ssdt

If you are using Visual Studio 2010 instead of Visual Web Developer 2010, you need to install WPI installer for ASP. net mvc 4 and Visual Studio 2010 prerequisites

C # example in this articleSource codeIs a visual web developer project: Download the C # sample source in this articleCode.

What kind of applications will be built in this example?

You will implement a simple movie list application that supports creating, editing, searching, and selecting a movie list from the database. The following are two screenshots of the application you have built. This page displays the list of movies selected from the database:

The application also allows you to add, edit, and delete movies and display details of a single record. All user data input scenarios contain data verification logic to ensure that the data stored in the database is correct.

Getting started

Run Visual Studio express 2012 or visual web developer 2010 express to start this example. Most Visual Studio express 2012 screens are used in this series, you can also use Visual Studio 2010/SP1, Visual Studio 2012, Visual Studio express 2012, or visual web developer 2010 express to complete this tutorial. Slave"Start"Page, select"Create a Project".

Visual Studio is an integrated IDE development environment. Just as if you use Microsoft Word to write documents, you can use the integrated development environment (IDE) to create an application. Different options are displayed in the top toolbar of Visual Studio for your use. There is also a menu in IDE that provides another way to execute tasks. (For example"Start"Page, select"Create a project", You can use this menu, and then select"File">"Create a project")

Create your first application

You can use Visual Basic or C #Programming LanguageTo create your application. Select Visual C # on the left, and then selectASP. net mvc 4 WebApplications. Name your project as "mvcmovie", and then clickOK.

InNewASP. net mvc 4ProjectIn the dialog box, selectInternet applications. UseRazorAs the default view engine.

ClickOK. The ASP. net mvc project created in Visual Studio uses the default template, so you do not need to do anything in the current project! This is a simple "Hello world! "Project, and this is also a good place for you to start the" mvcmovie "project.

SlaveDebuggingIn the menu, selectStart debugging.

Note that you can also use the keyboard shortcut F5 to start debugging.

F5 enables Visual Studio to start IIS express and run web applications. Visual Studio then starts the browser and opens the main page of the application. Note that the address bar of the browser displays localhost instead of This is because localhost is always resolved to your local computer. In this case, this is the application you just created. When Visual Studio runs a web project, a Web service with a random port is used. In the image below, the port number is 41788. When you run the application, you may see a different port number.

On the right side of the default template page, the "home", "about", and "Contact" pages are provided. It also provides registration and login functions, and links to Facebook and Twitter. The next step is to modify the default application and learn about ASP. net mvc. Close the browser and let's modify some source code.


Download the complete document:ASP. NET mvc41_1_timeout


Certificate -----------------------------------------------------------------------------------------------------------------------------------------------


9 articles in this seriesArticle, Translated from ASP. net mvc4 official tutorial, due to the concise description of this series of articles, the length is moderate, from an example to explain, the full text finally completed a small system for managing movies, very suitable for beginners ASP.. Net mvc4. Nine articles:

1. Introduction to ASP. NET mvc4

· Original address:

· Address:

2. Add a controller

· Original address:

· Address:

3. Add a view

· Original address:

· Address:

4. Add a model

· Original address:

· Address:

5. Access the data model from the Controller

· Original address:

· Address:

6. Verify the editing method and view

· Original address:

· Address:

7. Add new fields to the movie table and Model

· Original address:

· Translation address:Http://

8. Add a validator to the Data Model

· Original address:

· Address:

9. query details and delete records

· Original address:

· Address:

10. Third-party control studio for ASP. NET wijmo mvc4 tool Application



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: 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.