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

analog of .NET Request.ApplicationPath

Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the same
functionality that has ASP.NET (Request.ApplicationPath)

TIA
--
Vadym Stetsyak
Jul 22 '05 #1
5 2374
Vadym Stetsyak wrote:
Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the
same functionality that has ASP.NET (Request.ApplicationPath)

Use Server.MapPath

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Vadym Stetsyak wrote:
Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the
same functionality that has ASP.NET (Request.ApplicationPath)

Use Server.MapPath

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #3
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

Vadym Stetsyak wrote:
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Vadym Stetsyak wrote:
Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the
same functionality that has ASP.NET (Request.ApplicationPath)

Use Server.MapPath

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4
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

--

"Vadym Stetsyak" <va*****@ukr.net> a écrit dans le message de
news:uB**************@TK2MSFTNGP10.phx.gbl...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Vadym Stetsyak wrote:
Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the
same functionality that has ASP.NET (Request.ApplicationPath)

Use Server.MapPath

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 22 '05 #5
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 :8-)

imho it will be better than parsing...

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:#I**************@TK2MSFTNGP10.phx.gbl...
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

Vadym Stetsyak wrote:
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Vadym Stetsyak wrote:
Hi, All!

For example if I have
http://server/myvirtualpath/someotherpath/page.asp

and virtual path on the IIS is http://server/myvirtualpath

How can I retrieve above mentioned asp application path. I need the
same functionality that has ASP.NET (Request.ApplicationPath)

Use Server.MapPath

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #6

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

Similar topics

0
by: Jim Corey | last post by:
I've seen this same sort of code (below) on other posts. This works fine for me on my development machine, but not when I move it to my hosted site. When I view the source from my machine, I...
2
by: martin | last post by:
Hi, I am developing a class to help my asp.net application along. The class is part of a seperate project although this project is included in the same solution as my main web application. I...
1
by: Ponnurangam | last post by:
Hi, I have completed a website using Request.ApplicatioPath in a lot of places. eg.: (<img src='<%= Request.ApplicationPath %>/Images/logo.gif' />) It works locally, but doesn't work thru...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
2
by: ad | last post by:
I want to get the Application path, I use the code: string sDir = Request.ApplicationPath ; It run well in code behind, but if I place the code above in Global.asax like: void...
0
by: Chris | last post by:
Hi, i use a masterpage in my application. When navigating to another site without closing the browser and then coming back to the application, the images and css styles are lost. So i did...
0
by: Chris | last post by:
Hi, When navigating to another site without closing the browser and then coming back to the application, the images and css styles are lost. So i did this for the images: <img...
5
by: Rory Becker | last post by:
I have had code in my Application_Start which is intended to run once at the start of my application's life. It loads connection information and similar from a known location. However I...
2
by: CKKwan | last post by:
Dear All, Using VS2008 on Vista (IIS7). Request.ApplicationPath return something like "http://localhost:50440/" When deploy into Server 2003 (IIS6), found that Request.ApplicationPath is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.