473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filepath of include file

Hi,
Is there a way to determine the filepath of an included file?:

First file contains:
<!--#include file="WysiwygEd/Inc_WysiwygEd.asp" -->
<%SomeSub%>

Second file Inc_WysiwygEd.asp contains:
<%
sub SomeSub
'I need to know the URL of the included file here to determine the
location of resources like images
end sub
%>
Thanks,
Christiaan
Jul 19 '05 #1
2 1608
Hi,

All the code from the included file is "pasted" into the calling file. To
find the path of the calling file, you can use Server.Mappath() however,
that's largely irrelevant for the web, since you want the virtual path. You
can get this using

Request.ServerVariables("Script_Name")
http://msdn.microsoft.com/library/de...om_reqocsv.asp

Cheers
Ken

"Christiaan Nijdam" <ac*************@yahoo.com> wrote in message
news:83**************************@posting.google.c om...
: Hi,
:
:
: Is there a way to determine the filepath of an included file?:
:
: First file contains:
: <!--#include file="WysiwygEd/Inc_WysiwygEd.asp" -->
: <%SomeSub%>
:
: Second file Inc_WysiwygEd.asp contains:
: <%
: sub SomeSub
: 'I need to know the URL of the included file here to determine the
: location of resources like images
: end sub
: %>
:
:
: Thanks,
: Christiaan
Jul 19 '05 #2
Hi Ken,
The code is not simply pasted into the calling file. When the included
file contains a compile or runtime error the asp engine is able to
show the line number and the name of the included file where the error
occured...
Christiaan.

"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message news:<uv**************@TK2MSFTNGP09.phx.gbl>...
Hi,

All the code from the included file is "pasted" into the calling file. To
find the path of the calling file, you can use Server.Mappath() however,
that's largely irrelevant for the web, since you want the virtual path. You
can get this using

Request.ServerVariables("Script_Name")
http://msdn.microsoft.com/library/de...om_reqocsv.asp

Cheers
Ken

"Christiaan Nijdam" <ac*************@yahoo.com> wrote in message
news:83**************************@posting.google.c om...
: Hi,
:
:
: Is there a way to determine the filepath of an included file?:
:
: First file contains:
: <!--#include file="WysiwygEd/Inc_WysiwygEd.asp" -->
: <%SomeSub%>
:
: Second file Inc_WysiwygEd.asp contains:
: <%
: sub SomeSub
: 'I need to know the URL of the included file here to determine the
: location of resources like images
: end sub
: %>
:
:
: Thanks,
: Christiaan

Jul 19 '05 #3

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

Similar topics

0
by: Todd Richardson | last post by:
I have written a web form which downloads files to the client automatically. After the download completes, I would like to delete the file that was downloaded. I can't tell how to wait until the...
9
by: mjakowlew | last post by:
Hi, I'm trying to use some string manipulation from a file's path. filepath='c:\documents\web\zope\file.ext' I need to extract everthing after the last '\' and save it. I've looked around...
3
by: Darrel | last post by:
using Request.FilePath will return the entire file path: directory/directory/myfile.aspx Is there a built function in ASP.net to grab just the filename (myfile.aspx) or do I need to write...
1
by: Cindy H | last post by:
Hi I used the code below to automatically open a pdf file when the user clicks on a menu option. It works great on local machine, but when I uploaded it to hosting site and then tried it, I...
12
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
10
by: ganeshp | last post by:
Below given is the code to check if a file exists. This code works on Windows but on Linux it fails even when the file exists. Please let me know if you have a solution or a work around for this....
1
by: ateale | last post by:
Hi Guys, Can anyone advise on how to get get a file's filepath via a form? I am working on using a form to allow a user to select a file, then the app uses FTP to transfer the file to the...
0
by: =?Utf-8?B?UmljaGFyZCBDb2xsZXR0ZQ==?= | last post by:
I have a web application which references a service tier class library/assembly. The service tier assembly takes a domain object, serializes it to xml and then performs a translation to generate...
2
by: fusionfusion | last post by:
Hi I want to avoid hardcoding the filepath in my C program. I want to store the filepath in a variable in a text file. then i have to pass that variable to another file. ex....
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
jinu1996
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...
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.