简体   繁体   English

如何在Web应用程序的子目录中初始化某些类

[英]How to initialize some classes in a subdirectory in web application

I am working on an existing web application, I created a folder called Portal under the Web project, this folder was converted to an Application in IIS, it now has its own web.config. 我正在使用现有的Web应用程序,我在Web项目下创建了一个名为Portal的文件夹,此文件夹已转换为IIS中的Application,现在它具有自己的web.config。 In the Web project there is a Global.asax, and it initializes some classes I now need to use from the folder that was converted to Application, the problem is that the folder is not picking up the initializations from the web (parent) global asax. 在Web项目中,有一个Global.asax,它初始化了我现在需要从转换为Application的文件夹中使用的某些类,问题是该文件夹没有从Web(父)全局asax接收初始化。 。 Is there a way either to add a second global asax or any other way to initialize stuff for the portal (sub folder application) when the application starts? 当应用程序启动时,是否可以添加第二个全局asax或其他任何方法来初始化门户(子文件夹应用程序)的内容?

This is by no means an answer but i suggest u do not skip reading these links. 这绝不是答案,但我建议您不要跳过阅读这些链接。 there might be something in it for everyone. 每个人中可能都有某些东西。 It would be challenging for multiple Applications to share the same Session.. 多个应用程序共享同一会话将是一个挑战。

Using ServerManager to create Application within Application 使用ServerManager在应用程序内创建应用程序

http://codeidol.com/asp/c-sharp-asp-xml-ado.net/Configuration-and-Deployment/Initializing-Web-Applications-Using-Global.asax/ http://codeidol.com/asp/c-sharp-asp-xml-ado.net/Configuration-and-Deployment/Initializing-Web-Applications-Using-Global.asax/

Apart from those links i can only leave u with some theory without any practical examples and see if u can work your way through. 除了这些链接之外,我只能在没有任何实际例子的情况下给您一些理论知识,看看您是否可以自己解决问题。

You can also use the post method to communicate the application object among different doamins 您还可以使用post方法在不同区域之间通信应用程序对象

Use a controller action to manually POST the application object to the other domain, the POST will take place via an SSL connection 使用控制器动作将应用程序对象手动发布到另一个域,该发布将通过SSL连接进行

You can use database to store and retrive the application object, application object get created when first time website surfed. 您可以使用数据库来存储和检索应用程序对象,当首次浏览网站时会创建应用程序对象。

You can also use hidden fields. 您还可以使用隐藏字段。

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

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