Forums

This topic is locked

SSI

Posted 04 May 2002 02:07:29
1
has voted
04 May 2002 02:07:29 Arnold Ho posted:
Let's say I have the following.



menu.asp
article.asp
1.htm
2.htm
3.htm
-----------------------------
ID Text Link
-----------------------------
1 Page 1 1.htm
2 Page 2 2.htm
3 Page 3 3.htm
-----------------------------



menu.asp links
Page 1 (article.asp?ID=1)
Page 2 (article.asp?ID=2)
Page 3 (article.asp?ID=3)



I have got "article.asp" to display text from the database according to the

parameters given to it.

But do I get "article.asp" to display another page(in my case, the .htm pages)

according to the parameters given to it?



I tried using SSI in "article.asp".
<!--#include virtual="<%=(Recordset1.Fields.Item("Link".Value)%>"-->

I get an error.
The include file '<%=(Recordset1.Fields.Item(' was not found.
/article.asp, line 13



What is wrong? Is there any better way to do it??

Replies

Replied 04 May 2002 03:34:10
04 May 2002 03:34:10 Andrew Watson replied:
I know what you mean...

Its because your nesting script tags, the asp wont run inside the ssi tags.

I had a similar problem trying to use a dynamic session variable name ....

<pre id=code><font face=courier size=2 id=code>
&lt;% Session("&lt;%=Request.Querystring("Session" %&gt;" %&gt; </font id=code></pre id=code>

Which is blatantly wrong so im interested in finding out how to do this...or if you can do this.!

:: Son, im Thirty.... ::
Replied 04 May 2002 03:37:15
04 May 2002 03:37:15 Andrew Watson replied:
PS.

You could use...

<pre id=code><font face=courier size=2 id=code>
&lt;% If Request.Querystring("ID" = 1 Then %&gt;
&lt;!--#include virtual="1.htm"--&gt;
&lt;% End If %&gt;
</font id=code></pre id=code>

But youd need a statement for every include, not exactly dynamic....

:: Son, im Thirty.... ::
Replied 04 May 2002 09:35:28
04 May 2002 09:35:28 Arnold Ho replied:
I know now that I cant do it using SSI since includeds are processed first
&lt;!--#include file="&lt;%=myvariable%&gt;"--&gt;


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
PS.

You could use...

<pre id=code><font face=courier size=2 id=code>
&lt;% If Request.Querystring("ID" = 1 Then %&gt;
&lt;!--#include virtual="1.htm"--&gt;
&lt;% End If %&gt;
</font id=code></pre id=code>

But youd need a statement for every include, not exactly dynamic....

:: Son, im Thirty.... ::
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic