I am writing an application which will have live and test environments in Classic ASP. These use includes a lot. However, because includes are processed before ASP, I can’t simply say something like the following:
<%
if <Test Environment Condition> then
%>
<!-- #include virtual="/myAppTest/start.asp" -->
<%
else
%>
<!-- #include virtual="/myApp/start.asp -->
<%
end if
%>
This would basically load BOTH includes into BOTH environments, and throw an error in BOTH environments if there is a malformed function or something similar in ONE environment. The only way I can see, to separate the environments, is to have one virtual directory which simply contains a URL (either /myApp or /myAppTest) and this URL is used in jQuery .load URLs, for example. The only way forward I can see is loading content dynamically via JS.
Another workaround is to have the same virtual directory on 2 servers, one test and one live. However for reasons too complex and possibly too confidential to explain, this option is out the window.
Is the first method, loading content dynamically via JS, the best way or am I missing something?
Thanks in advance.
Regards,
Richard
Set the app up under a different website, not under a vdir.