热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

正确使用ASP.NET网站中的文件设计器文件-ProperlyusingfileDesignerFilesinASP.NETWebSites

IneedtogetexistingwebpagesintoanexistingASP.NETwebsiteprojectinVisualStudio2008.I

I need to get existing web pages into an existing ASP.NET web site project in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder.

我需要将现有的Web页面放入Visual Studio 2008中的现有ASP.NET网站项目中。我只是尝试将整个文件夹内容拖放到Visual Studio Solution Explorer中,甚至将它们复制到Web站点文件夹中。

Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or .master) file, even after restarting the whole IDE. The Solution Explorer entry looks in a way like this:

两种方式,Visual Studio似乎无法将.designer.cs文件映射到相应的.aspx(或.master)文件,即使在重新启动整个IDE之后也是如此。解决方案资源管理器条目的外观如下:

- Main.aspx
    Main.aspx.cs
  Main.aspx.designer.cs

Can I make Visual Studio file the designer-file below the aspx-file in any way? I strongly hope there is a simpler way than manually creating each file and copying and pasting the contents into each file by hand.

我可以以任何方式将Visual Studio文件设置为aspx文件下的设计器文件吗?我强烈希望有一种比手动创建每个文件更简单的方法,并手动将内容复制并粘贴到每个文件中。

3 个解决方案

#1


3  

It sounds like you are trying to bring web application files into a web site. IIf that is the case, The designer files are not even needed. Just dont include them. They are generated and compiled in at runtime when the website runs.

听起来您正在尝试将Web应用程序文件带入网站。如果是这种情况,甚至不需要设计器文件。只是不要包括它们。它们是在网站运行时在运行时生成和编译的。

#2


1  

Kind of partially self-answering my question:

有点自我回答我的问题:

In a web project - in contrast to a web site - it works perfectly through drag and drop onto the solution explorer, as I did for the web site before. To make the decision which type of "web site unit" to use there is another thread here on stackoverflow: ASP.NET Web Site or Web Project.

在一个Web项目中 - 与网站相比 - 它可以通过拖放到解决方案资源管理器上完美地工作,就像我之前为网站所做的那样。要决定使用哪种类型的“网站单元”,stackoverflow上还有另一个线程:ASP.NET网站或Web项目。

In a web site I can't even use YonahW's solution, because I can't just put files into the proper web site directory without causing them to be added to the web site automatically. Thanks to you anyway, YonahW. :-)

在一个网站上,我甚至无法使用YonahW的解决方案,因为我不能将文件放入正确的网站目录而不会导致它们自动添加到网站。无论如何,谢谢你,YonahW。 :-)

#3


0  

try copying the files through the filesystem and then right clicking on the project and selecting to add an existing item at which point you can choose all at once and this usually puts them in the proper places.

尝试通过文件系统复制文件,然后右键单击项目并选择添加现有项目,此时您可以一次选择所有项目,这通常会将它们放在适当的位置。


推荐阅读
author-avatar
asdfu_814
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有