analog of .NET Request.ApplicationPath

V

Vadym Stetsyak

Server.MapPath - it maps relative or virtual path to the physical path.
I need something else, I want to obtain virtual root path, like /myapp

In asp.net Request.ApplicationPath - gives the application's virtual
application root path on the server. This is the kind of functionality I
need in the asp
 
B

Bob Barrows [MVP]

By using "/myapp" you have confused the issue. "myapp" appears nowhere in
the example you originally provided.

I was under the impression that ApplicationPath was equivalent to physical
path. It seems I was mistaken. Given the virtual paths you descibed
originally what do you wish to retrieve?

http://server/virtualpath ?
/virtualpath ?

I just looked it up: "Gets the ASP.NET application's virtual application
root path on the server."

So it appears you wish to obtain /virtualpath, correct?

There is nothing builtin for this. You will need to parse one of the
following servervariables:

APPL_MD_PATH
PATH_INFO
SCRIPT_NAME
URL

Bob Barrows
 
P

Patrice

AFAIK this is new in ASP.NET.

In ASP you don't have this information readily available. IMO you could wrap
this in a function that :
- calls Server.RequestVariables("APPL_PHYSICAL_PATH")
- use server.MapPath("/") to get the web site root

On Friday I'll avoid to exhaust my last neural resources but from there you
should be able to extract the virtual path (get those appl_physical_path
chars that exceed the MapPath("/") etc...)

Zzzzzzzz....

Patrice
 
V

Vadym Stetsyak

Yes, you're correct, I want /virtualpath

As my web app is a combination of asp and asp.net I think that asp.net part
will tell asp part what is its virtual path ::cool:

imho it will be better than parsing...
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top