Forums
This topic is locked
Dynamic ASP Server Side Includes
03 Nov 2002 11:47:06 Q Qwerty posted:
Hi there,I know in principal dynamic server side includes aren't possible in ASP, because of the way ASP parses pages, but I also heard that there's a workaround for this. Note that my include-pages are ASP pages themselves and I know this complicates things a bit.
I tried it with the following code:
<pre id=code><font face=courier size=2 id=code>
<%
Select Case pickFile
Case 1:
<!--#include file="/includes/index.asp"--%gt;
Case 2:
<!--#include file="/includes/products.asp"--%gt;
Case 3:
<!--#include file="/includes/articles.asp"--%gt;
End Select
%>
</font id=code></pre id=code>
The parameters are be passed on by the navigation menu. The problem is it doesn't return any page. Where the content should come, it stays blank. Anyone familiar with dynamic SSI?
Replies
Replied 04 Nov 2002 14:21:56
04 Nov 2002 14:21:56 Vince Baker replied:
Your problem is that each of your includes load before the decision to choose one (from your case statement) is processed. You will need to have an intermediate page that decides which include is to be loaded.
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 07 Nov 2002 02:52:54
07 Nov 2002 02:52:54 Dave Blohm replied:
I'm afraid that bakerv is mistaken...
here is the problem with your code...
you need to put the include statement OUTSIDE the code blocks...the include staement must be called from the basic HTML like so:
<% Select Case pickFile
Case "1" %>
<!--#include file="/includes/index.asp"-->
<% Case "2" %>
<!--#include file="/includes/products.asp"-->
<% Case "3" %>
<!--#include file="/includes/articles.asp"-->
<%End Select %>
That should work so long as pickFile is being populated with a value somewhere along the line...
Doc
Rangewalk Digital Studios
www.rangewalk.com
Edited by - on 08 Nov 2002 04:15:32
here is the problem with your code...
you need to put the include statement OUTSIDE the code blocks...the include staement must be called from the basic HTML like so:
<% Select Case pickFile
Case "1" %>
<!--#include file="/includes/index.asp"-->
<% Case "2" %>
<!--#include file="/includes/products.asp"-->
<% Case "3" %>
<!--#include file="/includes/articles.asp"-->
<%End Select %>
That should work so long as pickFile is being populated with a value somewhere along the line...
Doc
Rangewalk Digital Studios
www.rangewalk.com
Edited by - on 08 Nov 2002 04:15:32
Replied 07 Nov 2002 09:01:13
07 Nov 2002 09:01:13 Vince Baker replied:
I stand corrected.....
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting