2017-03-30 05:15:18 +08:00
|
|
|
---
|
2017-07-01 07:47:15 +08:00
|
|
|
title: Adding a controller
|
2017-03-30 05:15:18 +08:00
|
|
|
author: rick-anderson
|
|
|
|
description: How to add a controller to a simple ASP.NET Core MVC app
|
|
|
|
keywords: ASP.NET Core, MVC
|
|
|
|
ms.author: riande
|
|
|
|
manager: wpickett
|
|
|
|
ms.date: 02/28/2017
|
2017-06-01 05:55:29 +08:00
|
|
|
ms.topic: get-started-article
|
2017-03-30 05:15:18 +08:00
|
|
|
ms.assetid: e04b6665-1638-4d99-1636-d666c4634666
|
|
|
|
ms.technology: aspnet
|
|
|
|
ms.prod: asp.net-core
|
|
|
|
uid: tutorials/first-mvc-app-xplat/adding-controller
|
|
|
|
---
|
|
|
|
|
2017-06-23 05:27:28 +08:00
|
|
|
# Adding a controller to a ASP.NET Core MVC app with Visual Studio Code
|
2017-03-30 05:15:18 +08:00
|
|
|
|
2017-06-17 05:40:44 +08:00
|
|
|
By [Rick Anderson](https://twitter.com/RickAndMSFT)
|
2017-03-30 05:15:18 +08:00
|
|
|
|
2017-06-17 05:40:44 +08:00
|
|
|
[!INCLUDE[adding-controller](../../includes/mvc-intro/adding-controller1.md)]
|
2017-03-30 05:15:18 +08:00
|
|
|
|
|
|
|
* In **VS Code**, select the **EXPLORER** icon and then control-click (right-click) **Controllers > New File**
|
|
|
|
|
|
|
|
![Contextual menu](adding-controller/_static/new_file.png)
|
|
|
|
|
2017-06-17 05:40:44 +08:00
|
|
|
[!INCLUDE[adding-controller2](../../includes/mvc-intro/adding-controller2.md)]
|
2017-03-30 05:15:18 +08:00
|
|
|
|
|
|
|
>[!div class="step-by-step"]
|
2017-04-15 01:46:51 +08:00
|
|
|
[Previous - Add a controller](start-mvc.md)
|
2017-06-23 05:27:28 +08:00
|
|
|
[Next - Add a view](adding-view.md)
|