5 2382
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.Applic ationPath)
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"
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.Applica tionPath - 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******@NOyah oo.SPAMcom> wrote in message
news:uz******** ******@TK2MSFTN GP10.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.Applic ationPath) 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"
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.Applica tionPath - 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******@NOyah oo.SPAMcom> wrote in message news:uz******** ******@TK2MSFTN GP10.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.Applic ationPath) 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"
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.RequestV ariables("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_p ath
chars that exceed the MapPath("/") etc...)
Zzzzzzzz....
Patrice
--
"Vadym Stetsyak" <va*****@ukr.ne t> a écrit dans le message de
news:uB******** ******@TK2MSFTN GP10.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.Applica tionPath - 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******@NOyah oo.SPAMcom> wrote in message news:uz******** ******@TK2MSFTN GP10.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.Applic ationPath) 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"
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******@NOyah oo.SPAMcom> wrote in message
news:#I******** ******@TK2MSFTN GP10.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.Applica tionPath - 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******@NOyah oo.SPAMcom> wrote in message news:uz******** ******@TK2MSFTN GP10.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.Applic ationPath)
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"
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 see:
src='/MyProjectFolder/Javascript/datepicker.js'
On the hosted site I get:
src='//Javascript/datepicker.js'
and it doesn't work.
Any ideas on what I can do to make the same code work both places?
|
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 wish to use the function "request.applicationpath" from inside my class.
In solution explorer I have right clicked on the references node and added a
reference to system.web.dll
|
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 internet after I deployed it.
It works if I move the whole website into a sub folder from the root folder.
|
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 post back, when
I try to retreive it from Request.Cookies collection, it appears that it does
not exists.
This problem does not occur on several developing machines we use for
developing application, but occurs in another environment (another...
|
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 Application_Start(Object sender, EventArgs e) {
string sDir = Request.ApplicationPath ;
}
| |
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 this for the images:
<img src="<%=Request.ApplicationPath%>/images/01.gif" />
and this works.
|
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 src="<%=Request.ApplicationPath%>/images/01.gif" />
and this works.
Now my css file (green.css) is in App_Themes/green and i refer to it from
|
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 recently migrated my app using
-------------------------------------------------------------
%systemroot%\system32\inetsrv\APPCMD.EXE migrate config "Default Web Site/YourApp"
-------------------------------------------------------------
|
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 returning "c:\\Inetpub\..."
May I know what has gone wrong?
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |