Filepath of include file

C

Christiaan Nijdam

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
 
K

Ken Schaefer

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/default.asp?url=/library/en-us/iisref/htm/ref_vbom_reqocsv.asp

Cheers
Ken

: 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
 
C

Christiaan Nijdam

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.
 

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
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top