更新时间:2023-02-25 16:41:54
的更新于2013年11月14日这个答案,官方发布VS2013反映在最终发布更改后-ds 的
对于Visual Studio 2013(发行版)
的注:最终版本带回了添加控制器上下文菜单的
简单的方法:
在你的MVC项目上右键点击控制器文件夹
Right Click on the "Controllers" folder in your MVC project
添加> 控制器...
选择一个控制器模板。 (我preFER MVC 5控制器空)
Choose a Controller Template. (I prefer MVC 5 Controller Empty)
另一种方法:
在你的MVC项目上右键点击控制器文件夹
Right Click on the "Controllers" folder in your MVC project
添加> 新建项目脚手架...
选择一个控制器模板
此方法还显示非控制模板,如景致,区域等的WebAPI功能上榜更长的时间。
This method also displays non-controller templates such as views, areas, and more WebAPI features making the list longer.
对于Visual Studio 2013(preVIEW和发布候选)
的注:VS 2013 preVIEW和RC不包括添加控制器上下文菜单的
要创建使用Visual Studio新的控制器2013 + ASP.NET MVC 5:
To create a new controller with Visual Studio 2013 + ASP.NET MVC 5:
???可以是空的意思控制器类只没有pre-内置的观点......所有MVC 5控制器具有读/写操作和视图,使用实体框架,它产生一个控制器类多种方法和方式相关查看.cshtml文件。
??? can be "Empty" meaning Controller class only with no pre-built views... all the way to "MVC 5 Controller with read/write actions and views, using Entity Framework" which produces a Controller class with multiple methods and associated View .cshtml files.
在Visual Studio + MVC,以前的版本添加控制器发起了一个可配置的支架向导。 2013年的preVIEW版本,而不是显示pre-建脚手架模板列表。
In prior versions of Visual Studio + MVC, "Add Controller" initiated a configurable scaffold wizard. The preview versions of 2013 instead displays a list of pre-built scaffolding templates.