简体   繁体   English

在VS2013 Express上添加视图时如何启用MVC 5 Razor模板

[英]How to enable MVC 5 Razor template when adding view on VS2013 express

On my VS2012 I can view the MVC 5 Razor template when adding view. 在我的VS2012上,添加视图时可以查看MVC 5 Razor模板。 See attachment: 详见附件: 在此处输入图片说明

But when I'm using VS2013 express edition I can only see is the MVC 5 View Page Razor. 但是当我使用VS2013 Express Edition时,我只能看到的是MVC 5 View Page Razor。 在此处输入图片说明

I already install everything but the rest razor template is not existing. 我已经安装了所有工具,但其余的剃刀模板不存在。 Help please... 请帮助...

You can use the top-most button in the Add context menu called View... (as can be seen in your second screenshot). 您可以使用“ Add菜单中名为“ View...的最上面的按钮(在第二张屏幕截图中可以看到)。 There, you can choose from different options (partial/non-partial, use/don't use a layout view), but the option for a layout page is not available there. 在这里,您可以从不同的选项中选择(部分/非部分,使用/不使用布局视图),但是那里没有用于布局页面的选项。 But you can just create a normal view and name it accordingly I guess. 但是我想您可以创建一个普通视图并据此命名。

Remark: My Visual Studio 2013 Premium additionally has the 4 buttons you are missing; 备注:我的Visual Studio 2013 Premium还具有您缺少的4个按钮; I don't have VS2013 Express to check that as well. 我也没有VS2013 Express来检查。

Additionally, the context menu Add => View... can also be opened by right-clicking inside an action method in the controller to create a view in the corresponding folder (using a template). 此外,还可以通过右键单击控制器中的操作方法以在相应文件夹中创建视图(使用模板)来打开上下文菜单“ Add => View... So you generally don't have to manually navigate to the Views folder. 因此,您通常不必手动导航到“ 视图”文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM