Finding My Virtual Directory During Application_Start Event

G

Guest

I realize that I could find my virtual directory using some of the methods in the HttpRequest object, but since the HttpRequest object is not in context during the Application_Start event, I'm at a loss for how to determine what virtual directory my web application is running in. Any suggestions?
 
S

Sam Fields

HttpContext.Current.Request.ApplicationPath

Nathan Phelps said:
I realize that I could find my virtual directory using some of the methods
in the HttpRequest object, but since the HttpRequest object is not in
context during the Application_Start event, I'm at a loss for how to
determine what virtual directory my web application is running in. Any
suggestions?
 
S

Sam Fields

Sorry for jumping on this ... didn't see that you've already stated that the
HttpRequest object is null during application_start. I've run into the same
problem -- only during design time. If anyone know of any objects that
would provide this, I'm interested in the answer as well. I ended up just
using the context at the page level and only during run-time.

Thanks, Sam
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top