NinjaTurtle
09-21-2005, 08:57 AM
i have a problem, in side the config.asp, i set a value :
strPath = "/myproject/"
i know that i cant set like this :
"<!--#INCLUDE FILE = "<%=strPath%>/class/User.asp"-->" for the Include file. or Even <!--#INCLUDE Virtual= "/class/User.asp"-->
Because of my project is quit big scale, many folders and Subfolders, may have sub- sub folders in future(not sure yet) so instead of i have to put "../" or "../../" any otherways of making it more flexible?
<!--#INCLUDE FILE = "../config.asp"-->
<!--#INCLUDE FILE = "../class/User.asp"-->
<!--#INCLUDE FILE = "../includes/functions.asp"-->
<!--#INCLUDE FILE = "../lib/lib.asp"-->
if abc = "" then
strIncludeFile="login.asp"
else
strIncludeFile="welcome.asp"
end if
<!--#INCLUDE FILE = "../template/template.asp"-->
will it be a problem if i use Sever.Execute?
in the template.asp:
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="19%" valign="top"><!--#INCLUDE FILE = "leftnav.asp"--></td>
<td width="81%">
<%
set objFso = CreateObject("Scripting.FileSystemObject")
if objFso.FileExists (Server.MapPath(strIncludeFile)) then
Server.Execute(strIncludeFile)
else
Response.Write "Missing/Incomplete "& strIncludeFile &" in your controller."
end if
%>
</td>
</tr>
</table>
strPath = "/myproject/"
i know that i cant set like this :
"<!--#INCLUDE FILE = "<%=strPath%>/class/User.asp"-->" for the Include file. or Even <!--#INCLUDE Virtual= "/class/User.asp"-->
Because of my project is quit big scale, many folders and Subfolders, may have sub- sub folders in future(not sure yet) so instead of i have to put "../" or "../../" any otherways of making it more flexible?
<!--#INCLUDE FILE = "../config.asp"-->
<!--#INCLUDE FILE = "../class/User.asp"-->
<!--#INCLUDE FILE = "../includes/functions.asp"-->
<!--#INCLUDE FILE = "../lib/lib.asp"-->
if abc = "" then
strIncludeFile="login.asp"
else
strIncludeFile="welcome.asp"
end if
<!--#INCLUDE FILE = "../template/template.asp"-->
will it be a problem if i use Sever.Execute?
in the template.asp:
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="19%" valign="top"><!--#INCLUDE FILE = "leftnav.asp"--></td>
<td width="81%">
<%
set objFso = CreateObject("Scripting.FileSystemObject")
if objFso.FileExists (Server.MapPath(strIncludeFile)) then
Server.Execute(strIncludeFile)
else
Response.Write "Missing/Incomplete "& strIncludeFile &" in your controller."
end if
%>
</td>
</tr>
</table>