1.Getting Started with ASP.NET MVC 5

本文档介绍了如何使用Visual Studio 2013创建并运行第一个ASP.NET MVC项目。通过简单的步骤,您可以安装所需软件,创建名为MvcMovie的应用,并了解基本的页面结构。此外,还提供了部署到Azure的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Getting Started

Start by installing and running Visual Studio Express 2013 for Web or Visual Studio 2013.

Visual Studio is an IDE, or integrated development environment. Just like you use Microsoft Word to write documents, you'll use an IDE to create applications. In Visual Studio there's a toolbar along the top showing various options available to you. There's also a menu that provides another way to perform tasks in the IDE. (For example, instead of selecting New Project from the Start page, you can use the menu and select File > New Project.)

 

 

Creating Your First Application

Click New Project, then select Visual C# on the left, then Web and then select ASP.NET  Web Application. Name your project "MvcMovie" and then click OK.

In the New ASP.NET Project dialog, click MVC and then click OK.

Visual Studio used a default template for the ASP.NET MVC project you just created, so you have a working application right now without doing anything! This is a simple "Hello World!" project, and it's a good place to start your application.

Click F5 to start debugging. F5 causes Visual Studio to start IIS Express and run your web app. Visual Studio then launches a browser and opens the application's home page. Notice that the address bar of the browser says localhost:port# and not something likeexample.com. That's because localhost always points to your own local computer, which in this case is running the application you just built. When Visual Studio runs a web project, a random port is used for the web server. In the image below, the port number is 1234. When you run the application, you'll see a different port number.

Right out of the box this default template gives you  Home, Contact and About pages. The image above doesn't show the HomeAboutand Contact links. Depending on the size of your browser window, you might need to click the navigation icon to see these links.

 


  

The application also provides support to register and log in. The next step is to change how this application works and learn a little bit about ASP.NET MVC. Close the ASP.NET MVC application and let's change some code.

For a list of current tutorials, see  MVC recommended articles.

See this App Running on Azure

Would you like to see the finished site running as a live web app? You can deploy a complete version of the app to your Azure account by simply clicking the following button.

You need an Azure account to deploy this solution to Azure. If you do not already have an account, you have the following options:

 

 

 

转载于:https://www.cnblogs.com/ChineseMoonGod/p/5155428.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值