ASP. MVC4 Getting Started Guide (1): Introduction

Source: Internet
Author: User
Tags visual studio 2010

Objective

This tutorial will explain the basics of using Microsoft's Visual Studio Express 2012 or Visual Web Developer Express Service Pack to build an ASP. NET MVC4 Web application 。 It is recommended that you use Visual Studio 2012 and you will no longer need to install any components to complete this tutorial. If you are using Visual Studio 2010, you must install the following components. You can install all of the required components by clicking on the link below:

    • Visual Studio Web Developer Express SP1 Prerequisites
    • WPI Installer for ASP 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 Prerequisit Es

In this article, the C # sample source code is a Visual Web Developer Project: Download the C # sample source code for this article.

What kind of application will this sample build?

You will implement a simple movie list application that will support the ability to create, edit, search, and select a movie list from the database. Here are two screenshots of the application you will build. It includes a movie list page that displays the selected from database:

The app also allows you to add, edit, and delete movies, as well as display the details of individual records. All user data entry scenarios contain data validation logic to ensure that the data stored in the database is correct.

Entry

Run Visual Studio Express 2012 or Visual Web Developer Express to start this example, most of which use the Visual Studio Express 2012 screen in this series, and you can also use the Visual Studio 2010/sp1,visual Studio 2012,visual Studio Express 2012 or Visual Web Developer Express to learn to complete this tutorial. From the start page, select New Project.

Visual Studio is an IDE integrated development environment. Just as you use Microsoft Word to write documents, you can use the Integrated development environment (IDE) to create an application. A variety of different options are displayed for you to use in one of the top toolbars in Visual Studio. There is also a menu in the IDE that provides another way to perform tasks. (For example, you can not select new Project from the start page, you can use the menu, and then choose file > " new Project ")

Create your first application

You can use Visual Basic or C # as the programming language to create your application. Select Visual C # on the left, and then select the ASP. NET MVC 4 Web application . Name your project "Mvcmovie", and then click OK .

In the new ASP. NET MVC 4 Project dialog box, select Internet Application . Use Razor as the default view engine.

Click OK . The ASP. NET MVC project that Visual Studio has just created uses the default template, so you don't need to do anything in the current project! This is a simple "Hello world!" "Engineering, and this is also a good place for you to start the" Mvcmovie "project.

From the Debug menu, select Start Debugging .

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

F5 enable Visual Studio to start IIS Express and run the Web application. Visual Studio then launches the browser and opens the application's main page. Note that localhost is displayed in the address bar of the browser instead of an address such as example.com. This is because localhost will always be resolved to your own local computer, in which case this is exactly the application you have just built. When Visual Studio runs a Web project, a Web service that uses a random port is used. In the picture 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, you are provided with home, about, and contact pages. It also provides registration and login features, and provides links to Facebook and Twitter. The next step is to modify this default application and learn some knowledge about ASP. Close the browser, let's modify some of the source code.

ASP. MVC4 Getting Started Guide (1): Introduction

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.