Re: why doesn't this scripted include work?With this script from test1.asp:
<!--webbot bot="HTMLMarkup" startspan -->
<% Option Explicit
'*
Dim strOTF
strOTF = Request.ServerVariables("PATH_TRANSLATED")
strOTF = Left(strOTF,InStrRev(strOTF,"\"))
strOTF = strOTF & "w" & Int((DatePart("y",Date())+6)/7) & ".htm"
'*
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FilExists(strOTF) Then
Dim objOTF
Set objOTF = objFSO.OpenTextFile(strOTF,1)
strOTF = objOTF.ReadAll()
Set objOTF = Nothing
End If
Set objFSO = Nothing
'*
Response.Write strOTF
%>
<!--webbot bot="HTMLMarkup" endspan -->
I get this error:
Microsoft VBScript compilation error '800a0400'
Expected statement
/OYB/Test1.asp, line 39
Option Explicit
^
WIth this script from page test2.asp:
<!--webbot bot="HTMLMarkup" startspan --><%
Dim incl
incl = "<!--#include file=" & Chr(34) & "/oyb/w##.htm" & Chr(34) & "-->"
Dim week
week = Replace(incl,"##",Int((DatePart("y",Date())+6)/7))
Response.Write week & vbCrLf
%><!--webbot bot="HTMLMarkup" endspan -->
I just get no included page. The rest of the page works i.e. shared borders, but no included content.
Note that both pages are .asp, renaming to .htm doesn't work either.
Also note that the lines:<!--webbot bot="HTMLMarkup" endspan --> are needed or the source gets reformatted really ugly. That may be a problem in itself, I don't know
I was under the impression that you couldn't call an include "on the fly". I believe you must do server.execute.
what errors are you generating?
--
Chris Leeds,
Microsoft MVP-FrontPage
ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
--
I'm not using the FP bot on the same page. I just mentioned that a different page uses a the bot to load the page and that works, so the location or style of the included page must be OK.
The FP bot has to be refreshed manually so I am trying a different approach i.e. ASP, but the page content doesn't show up. That is my issue.
You say you are using ASP already so why would you want to use a FP include too (you can't) instead of using an ASP include.
Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: .:mmac:. [mailto:
[email protected]]
Posted At: 16. januar 2005 21:48
Posted To: microsoft.public.frontpage.programming
Conversation: why doesn't this scripted include work?
Subject: why doesn't this scripted include work?
I am working around the limitation of a scheduled include web
bot and have this code in an ASP page on a win2k server.
<p><!--webbot bot="HTMLMarkup" startspan --><%
Dim incl
incl = "<!--#include file=" & Chr(34) &
"/oyb/w##.htm" & Chr(34) & "-->"
Dim week
week = Replace(incl,"##",Int((DatePart("y",Date())+6)/7))
Response.Write week & vbCrLf
%><!--webbot bot="HTMLMarkup" endspan --></p>
This page source shows up as :
...<p><!--#include file="/oyb/w3.htm"--></p>...
The included file (/oyb/w3.htm) exists and the source code
shows that the
script runs but the page stays blank and nothing is included.
What am I missing? are the comments necessary or part of the problem
BTW the web bot works to bring the page up so it's not a
problem with the
included page.