"TNG" wrote in message
news:SU**********************@phobos.telenet-ops.be...
: I try to accomplish something like this:
:
: <!--#include file="menu_<%response.write (strproduct)%>.html"-->
:
: But unfortunally, I quess there is something with my syntax... any idea ?
The include file executes for the ASP processor. The only way I know to use
an include file dynamically is to use server.execute.
I have an example:
Run this alone and it will report it's virtual path:
http://kiddanger.com/lab/serverdotexec.asp
Run it with ?q=a, ?q=b or ?q=c and it will also include the appropriate
file.
Here's the code:
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
dim q
q =
server.HTMLEncode(replace(replace(replace(Request. QueryString("q"),"'","''"),";",""),"--",""))
Response.Write Request.ServerVariables("SCRIPT_NAME") & "<br />" & vbCrLf
if q <> "" Then
select case q
case "a"
server.execute "/lab/serverdotexeca.asp"
case "b"
server.execute "/lab/serverdotexecb.asp"
case "c"
server.execute "/lab/serverdotexecc.asp"
case else
Response.Write "Nice try!"
Response.End
end select
end if
%>
This is serverdotexeca.asp. b and c are similar.
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
Response.Write "This is serverdotexeca.asp<br />" & vbCrLf
%>
HTH...
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp