Can I have a global.asax just for an application?

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

I have a web site that has a folder configured as an application. Is it
possible to have a global.asax in the folder and have any requests to
pages in the folder sent there instead of the main site?

The reason I ask is because I am developing the folder (ie the separate
application) in VWD, and it doesn't know it's part of a bigger site. It
only knows about this one folder, so it ignores the global.asax file in
the parent folder.

TIA
 
Hi Alan,

It's not a problem unless either site needs access to the Application State
of the other site.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
It's not a problem unless either site needs access to the Application State
of the other site.

No they don't. The problem is that when I move the global.asax from the
root folder to the subfolder (which is set up as an application in IIS),
the file is ignored and the code in the Application_BeginRequest event
handler isn't called.

It sounds like it should be called. Any idea why it isn't? Thanks for
the reply.
 
Every Application has to use its own global.asax. The global.asax is a class
that resides in the Application domain for that Application.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
Every Application has to use its own global.asax. The global.asax is a class
that resides in the Application domain for that Application.

That's what I thought, but it wasn't working.

Having said that, I just tried it again (machine been off over the
weekend and so is probably refreshed after having had a good sleep!!)
and it is working.

Weird. Thanks anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top