473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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)
Dec 15 '05 #1
4 1026
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.

"Alan Silver" <al*********@nospam.thanx> wrote in message
news:8G**************@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)

Dec 15 '05 #2
>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)
Dec 15 '05 #3
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.

"Alan Silver" <al*********@nospam.thanx> wrote in message
news:tn**************@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)

Dec 16 '05 #4
>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)
Dec 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jon Maz | last post by:
Hi All, I've just noticed that there seem to be two ways of setting up a global.asax file. At http://www.csharphelp.com/archives/archive206.html the global.asax example has Application_Start...
25
by: Sahil Malik [MVP] | last post by:
So here's a rather simple question. Say in an ASP.NET application, I wish to share common constants as static variables in global.asax (I know there's web.config bla bla .. but lets just say I...
2
by: PRTC | last post by:
I'm trying to use the global.asax in my new web aplication proyect using the Application start to store my connection string GLOBAL.ASAX.vb Sub Application_Start(ByVal sender As Object,...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
2
by: Michael Tissington | last post by:
How do I specify the CodeFile for my Global.asax file ? According to the documentation I can use the CodeFile attribute with Application, however when I try to use this I get an error saying that...
0
by: hynek.cihlar | last post by:
A strange behaviour thatI found in ASP.NET 2.0. I am trying to issue a callback request (handled by ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request in the client browser...
1
by: ttt.tas | last post by:
hi all, i'm using asp .net v1.1, when i publish my application on the server using xcopy, i find that the global.asax file is still there, shouldn't it be compiled and assembled?? what if i...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
1
by: Chris Peeters | last post by:
Hi, How do you use a global application class as in ASP.NET 1.0 ? I try to use the following Global-class but it doesn't work at all: In Global.asax: <%@ Application Language="C#"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.