简体   繁体   English

将ASP.NET页导入到现有的ASP.NET项目

[英]Import ASP.NET Page to Existing ASP.NET Project

I am new to ASP.NET and I was asked to create a portal program which will be just a part of the existing ASP.NET portal project. 我是ASP.NET的新手,我被要求创建一个门户程序,该程序只是现有ASP.NET门户项目的一部分。 Meaning, it will be just like 2 web pages and will be going to be added to the existing project. 就是说,它就像2个网页一样,将被添加到现有项目中。 The thing is I have to do it in a separate ASP.NET Project file. 问题是我必须在单独的ASP.NET Project文件中执行此操作。 I have the source code of the existing main project but I am not allowed to modify this unless the pages that I will develop are completed. 我拥有现有主项目的源代码,但是除非完成将要开发的页面,否则不允许修改它。 How can I do it? 我该怎么做? I know I just have to create a new project but what is the next step after that? 我知道我只需要创建一个新项目,但是接下来的下一步是什么? How can I import the one that I made to the main project? 如何将自己制作的作品导入主项目? They mention that I just have to export it as DLL but I have no idea how to do that. 他们提到我只需要将其导出为DLL,但是我不知道该怎么做。 Please help me. 请帮我。

I am not sure if I understood you right. 我不确定我是否理解正确。 If you just have to export the dll from the project that you created, right click on your solution, open the bin folder, you will see a file named yourprojectname.dll. 如果您只需要从创建的项目中导出dll,请右键单击您的解决方案,打开bin文件夹,您将看到一个名为yourprojectname.dll的文件。 Copy this to your target projects bin folder using the steps mentioned above. 使用上述步骤将其复制到目标项目的bin文件夹中。

If I understood it right, you are being asked to created a classlibrary or something and not an aspx page. 如果我理解正确,系统将要求您创建一个类库或其他内容,而不是aspx页面。 Again, I might be wrong, but others can help you if you are lucid about your requirement. 同样,我可能是错的,但是如果您对自己的要求很清楚,其他人可以为您提供帮助。

  1. Open your new project in Visual Studio. 在Visual Studio中打开您的新项目。
  2. Open the old project in Visual Studio. 在Visual Studio中打开旧项目。
  3. Right click the name of your new project on Solution Explorer, select Open Folder in File Explorer 在解决方案资源管理器上右键单击新项目的名称,在文件资源管理器中选择“打开文件夹”
  4. Copy the 2 new pages you created 复制您创建的2个新页面
  5. Go to the Visual Studio Instance of your old project. 转到旧项目的Visual Studio实例。 Click the name of the solution and CTRL + V or Right Click > Paste. 单击解决方案的名称,然后按CTRL + V或右键单击>“粘贴”。 (If there is a folder let's say Pages where ASPX files are located, click and paste there instead). (如果有一个文件夹,例如说ASPX文件所在的页面,请单击并粘贴到那里)。
  6. Your new files might not be included in the project and if its happens, click the 'Show all Files' option on the Solution Explorer. 您的新文件可能不包含在项目中,如果发生,请在解决方案资源管理器中单击“显示所有文件”选项。
  7. Right click on the 2 new ASPX files and select 'Include In Project'. 右键单击2个新的ASPX文件,然后选择“包含在项目中”。

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

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