简体   繁体   English

.cshtml文件不可见?

[英].cshtml files are not getting visible?

I am new to MVC and in the learning phase. 我是MVC的新手,正在学习阶段。 I Just installed the VS2010 in my system and trying to learn, by making a small application in the MVC but when I saw the tutorial there were some files in view folder having extension of .cshtml but when I created the project there was no file like this there were only aspx files, so where I am doing wrong. 我只是在系统中安装了VS2010并尝试通过在MVC中创建一个小应用程序来学习,但是当我看到本教程时,view文件夹中有一些扩展名为.cshtml的文件,但是当我创建该项目时,没有像这只有aspx文件,所以我做错了。

Visual Studio 2010 does support Razor Views. Visual Studio 2010确实支持Razor视图。 When creating a new MVC Project in VS just select Razor instead of ASPX in the View Engine Drop Down List. 在VS中创建新的MVC项目时,只需在View Engine下拉列表中选择Razor而不是ASPX。

Please see this link for and example Screen Shot: http://postimg.org/image/g15x54sbx/ 请参阅此链接,获取示例屏幕截图: http : //postimg.org/image/g15x54sbx/

There are two types of view engine available in Visual Studio 10. You need to select Rajor view engine while creating your project. Visual Studio 10中有两种可用的视图引擎。您需要在创建项目时选择Rajor视图引擎。

You can see following link for your reference. 您可以查看以下链接以供参考。 http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4 http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4

You have to choose the view engine as "Razor" . 您必须将视图引擎选择为“ Razor” Then it will create the view as .cshtml 然后它将创建为.cshtml的视图

选择剃刀

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

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