what alternatives are there to using global.asax?

后端 未结 3 892

I am using my own custom authentication with IIS, and I want the server on every page load (no matter what type of file) to first check the Application variable to se

3条回答
  •  旧巷少年郎
    2020-12-15 15:06

    Actually I believe there's just one global.asax per asp.net application. If you want example.com/subsite1 to be a different application from example.com/subsite2 you can create two different applications in IIS. As a result they'll run in entirely different application domains (although they may be in the same process (aspnet_wp.exe or w3wp.exe) and even share application pools). As such, if they're different applications they should also get to have independent global.asax files.

    To turn a directory into an application. Open IIS->Find the directory/sub site, right click->Properties->Home Directory tab->Click "Create".

    For more information on application domains and worker processes, consider reading this blog entry. Hope that helps.

提交回复
热议问题