By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Filepath of include file

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.