473,410 Members | 1,908 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,410 software developers and data experts.

Access Virtual Directory with Application_OnStart

I've got a scenario with a web application where I must
access the virtual directory being accessed from within
the Application_OnStart event handler. Specifically, I
have a series of IIS virtual directories which all point
to the same set of ASP pages. However, since each virtual
directory is a separate 'application', each has its own
set data which must be cached. To detect which data must
be cached for each virtual directory, I need to detect the
name of the virtual directoy being invoked from within the
Application_OnStart event.

The problem is that the Request.ServerVariables collection
is not avaiable within the Application_OnStart event
handler. Is there a workaround for this?

Thanks,
Mark
Jul 19 '05 #1
4 3701
CJM
This sounds liek a complicated design... can you give some background? There
may be an alternative design that avoids this problem...

CJM

"Mark Hoagland" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
I've got a scenario with a web application where I must
access the virtual directory being accessed from within
the Application_OnStart event handler. Specifically, I
have a series of IIS virtual directories which all point
to the same set of ASP pages. However, since each virtual
directory is a separate 'application', each has its own
set data which must be cached. To detect which data must
be cached for each virtual directory, I need to detect the
name of the virtual directoy being invoked from within the
Application_OnStart event.

The problem is that the Request.ServerVariables collection
is not avaiable within the Application_OnStart event
handler. Is there a workaround for this?

Thanks,
Mark

Jul 19 '05 #2
put your init code into session_onstart
use an app var as a flag to skip the init code if a particular virtual dir
has already been initialized.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Mark Hoagland" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
I've got a scenario with a web application where I must
access the virtual directory being accessed from within
the Application_OnStart event handler. Specifically, I
have a series of IIS virtual directories which all point
to the same set of ASP pages. However, since each virtual
directory is a separate 'application', each has its own
set data which must be cached. To detect which data must
be cached for each virtual directory, I need to detect the
name of the virtual directoy being invoked from within the
Application_OnStart event.

The problem is that the Request.ServerVariables collection
is not avaiable within the Application_OnStart event
handler. Is there a workaround for this?

Thanks,
Mark

Jul 19 '05 #3
Session_OnStart is not a viable alternative because we
have session state disabled on all virtual directories.
We've found that enabling session state decreases the
scalability of our application by 25-40%, so we always
disable session state.

As for the overall design of the application, it is a
massive ASP based application with about 2500 pages for
managing customer interactions. The reason that we must
have multiple virtual directories pointing to the same
code base is that I work for a hosting company, so we have
multiple customers on the same application. The trick is
that the application is based upon a packaged, enterprise
software application so we must upgrade our modified
version of the product periodically and to minimize the
overall maintenance and upgrade effort we keep all of our
customers on a single code base. We initially started out
with each virtual directory pointing to a separate copy of
the code, but found that propagating changes to the
servers would take 10+ hours. Plus, the overall effort to
manage that many 'sets' of code was going to force us to
hire at least one additional programmer.

-----Original Message-----
put your init code into session_onstart
use an app var as a flag to skip the init code if a particular virtual dirhas already been initialized.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Mark Hoagland" <an*******@discussions.microsoft.com> wrote in messagenews:05****************************@phx.gbl...
I've got a scenario with a web application where I must
access the virtual directory being accessed from within
the Application_OnStart event handler. Specifically, I
have a series of IIS virtual directories which all point
to the same set of ASP pages. However, since each virtual directory is a separate 'application', each has its own
set data which must be cached. To detect which data must
be cached for each virtual directory, I need to detect the name of the virtual directoy being invoked from within the Application_OnStart event.

The problem is that the Request.ServerVariables collection is not avaiable within the Application_OnStart event
handler. Is there a workaround for this?

Thanks,
Mark

.

Jul 19 '05 #4
sounds like you are between the ol' rock and hard place.

Do users always enter the application through the same ASP page (default.asp
for instance)?
If so, add the initialization code to that page. Check for a specific app
var to avoid re-initialization.

Another option would be to set up a manual initialization page that you
could call directly after the web-server is re-started to load the
application vars. Then call it via each valid path (this would be
problematic if your server does unattended restarts).

Yet another option would be to add an include file to each page that a user
might enter the app with. You might be able to do something like this with a
global search/replace utility.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Mark Hoagland" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Session_OnStart is not a viable alternative because we
have session state disabled on all virtual directories.
We've found that enabling session state decreases the
scalability of our application by 25-40%, so we always
disable session state.

As for the overall design of the application, it is a
massive ASP based application with about 2500 pages for
managing customer interactions. The reason that we must
have multiple virtual directories pointing to the same
code base is that I work for a hosting company, so we have
multiple customers on the same application. The trick is
that the application is based upon a packaged, enterprise
software application so we must upgrade our modified
version of the product periodically and to minimize the
overall maintenance and upgrade effort we keep all of our
customers on a single code base. We initially started out
with each virtual directory pointing to a separate copy of
the code, but found that propagating changes to the
servers would take 10+ hours. Plus, the overall effort to
manage that many 'sets' of code was going to force us to
hire at least one additional programmer.

-----Original Message-----
put your init code into session_onstart
use an app var as a flag to skip the init code if a

particular virtual dir
has already been initialized.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Mark Hoagland" <an*******@discussions.microsoft.com>

wrote in message
news:05****************************@phx.gbl...
I've got a scenario with a web application where I must
access the virtual directory being accessed from within
the Application_OnStart event handler. Specifically, I
have a series of IIS virtual directories which all point
to the same set of ASP pages. However, since each virtual directory is a separate 'application', each has its own
set data which must be cached. To detect which data must
be cached for each virtual directory, I need to detect the name of the virtual directoy being invoked from within the Application_OnStart event.

The problem is that the Request.ServerVariables collection is not avaiable within the Application_OnStart event
handler. Is there a workaround for this?

Thanks,
Mark

.

Jul 19 '05 #5

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

Similar topics

0
by: Dwaine | last post by:
I got stumpped on this a while back and used a workaround that involved the "same local username/pwd on both servers" method. Now I'd like to find a cleaner method.... The setup: A webApp...
2
by: Edward W. | last post by:
I wrote my web service and I have no problem browsing to the asmx file and seeing the public methods. I can even invoke them with no problem. But in my asp.net application I get this error...
4
by: Martin | last post by:
Hi, I am getting an "Access Denied" error when attempting to browse asp.net pages. I have installed ASP.NET 1.1.4322 on a domain controller. The machine also has ASP.NET 1.0.3705 installed on...
0
by: Yogesh Pancholi | last post by:
For some unexplained reason, I am suddenly unable to browse to a virtual directory on my laptop. I have a number of sample websites to which I could happliy browse up until last week. As of Monday,...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
2
by: Rose winsle | last post by:
Hi guys ... I just wanted to create virtual directory using VB.net . i can manage that ... when i create the virtual directory how can i set anonymous access off. following is my code...
1
by: charlieruss | last post by:
Hello, My problem is as follows: I am using IIS 5.1 with .net 1.1 I have a shared folder on a different computer on our network which I want to add as a virtual directory on my computer so that...
2
by: charlieruss | last post by:
Hello, My problem is as follows: I am using IIS 5.1 with .net 1.1 I have a shared folder on a different computer on our network which I want to add as a virtual directory on my computer so that I...
7
by: Fred | last post by:
I have a file (access.php) with the db username and pwd, which I include in every php file that needs db access. I'm not clear on how to set the path. I have an account on a shared *nix server,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.