Home All Groups Group Topic Archive Search About

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

Author
15 Dec 2005 9:33 PM
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

--
Alan Silver
(anything added below this line is nothing to do with me)

Author
15 Dec 2005 10:00 PM
Kevin Spencer
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.

Show quoteHide quote
"Alan Silver" <alan-silver@nospam.thanx> wrote in message
news:8GdHtmAiEeoDFwRC@nospamthankyou.spam...
> 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
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
Are all your drivers up to date? click for free checkup

Author
15 Dec 2005 10:47 PM
Alan Silver
>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.

--
Alan Silver
(anything added below this line is nothing to do with me)
Author
16 Dec 2005 1:52 PM
Kevin Spencer
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.

Show quoteHide quote
"Alan Silver" <alan-silver@nospam.thanx> wrote in message
news:tnCTVZBcKfoDFwBl@nospamthankyou.spam...
> >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.
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
Author
19 Dec 2005 3:24 PM
Alan Silver
>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.

--
Alan Silver
(anything added below this line is nothing to do with me)

Bookmark and Share