简体   繁体   English

Visual Studio 2012-无模型文件夹

[英]Visual Studio 2012 - No Model Folder

I started a project in Visual Studio 2012. I selected the ASP.NET Web Forms Application but the folder structure does not contain a model folder. 我在Visual Studio 2012中启动了一个项目。我选择了ASP.NET Web窗体应用程序,但文件夹结构不包含模型文件夹。 Is there a setting there needs to be changed for this to be created? 是否需要更改设置才能创建此设置? However, creating a similar project in Visual Studio 2013 contains a model folder. 但是,在Visual Studio 2013中创建类似项目将包含模型文件夹。 Is there a difference because of the Visual Studio editions? 由于Visual Studio版本不同吗?

It is new in Visual Studio 2013. Previously, it was only MVC with a Models folder as it has Model-View-Controller architecture, an I think Microsoft found out it is a good idea to keep models in a Model folder even when it is Web Form. 它是Visual Studio 2013中的新功能。以前,它只有带有Models文件夹的MVC,因为它具有Model-View-Controller体系结构,我认为Microsoft发现,即使在模型文件夹中也保留模型,这是一个好主意。网络表单。 You can create it manually. 您可以手动创建它。 Click on the project name on solution explorer, right click, on menu go to add-> New Folder and call it Models 在解决方案资源管理器上单击项目名称,右键单击,在菜单上转到“添加”->“新文件夹”,并将其命名为“模型”

在此处输入图片说明

ASP.NET web forms template does not include a Models folder, you're looking for ASP.NET MVC instead. ASP.NET Web表单模板不包含Models文件夹,而您正在寻找ASP.NET MVC。 在此处输入图片说明

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

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