FSO or XMLHTTP

P

Pietro

One of the limitations of ASP is the lack of a dynamic SSI, in which you can
include files using variables. So far I know only of two methods to go
around that.

1. to use the File System Object
2. to use the XMLHTTP Object

Which one of the two is less of a burden for IIS ? Or are there other ways
that are much better? Thanks in advance.
 
S

Sylvain Lafontaine

Yes, there is another one: you can use the old Scriptlet technology which
gives you the possibility of transforming into a COM component a piece of
Javascript/VBScript or an ASP page. See for example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting091399.asp .

The whole site at Renaud-Bray has been designed this way: each displayed
page is in fact an association of multiples scriptlets and the list, order
and place of these scriptlets are stored in a database and can be changed at
will (or even be drawn at random). However, this is now an old and obsolote
technology and I don't think that you will find much information about it
(or about ASP) on the internet. You can try searching for key words like
SCRIPTLET and WSH.
 
P

Pietro

I read somewhere:

" Another potential drawback with Server.Execute is that any page-scope
variables are not shared between the original page and the executed page. "

Does that mean that variables declared (with Dim ...etc) in the "mother"
page are not passed to the "included" one?? That'd might be a problem.
 
R

Ray Costanzo [MVP]

Yes, that is what it means, and it does kinda suck...

Dim x
x = 3
Server.Execute "somepage.asp"

-----
somepage.asp:

Option Explicit
Response.WRite x

-----
result:

Variable not declared 'x'


You can kinda do conditional includes. You can do:

Dim x
x = 3
Select Case x
Case 1 %>
<!-- #include file="file1.asp" -->
<% Case 2 %>
<!-- #include file="file2.asp" -->
<% Case 3 %>
<!-- #include file="file3.asp" -->
<% Case Else %>
<!-- #include file="else.asp" -->
<%
End Select
'...
%>

But, with that, all of your files are actually included. It's just that the
code only in one of them will be executed.

Ray at work
 
P

Pietro

That's all very limiting. I tried passing variables to the page called with
server.execute in a querystring, and got an error when loading the parent
page.

" Invalid URL form or fully-qualified absolute URL was used. Use relative
URLs. "

Oh, well.
 
P

Pietro

I also noticed that variables created in the child page are not accepted by
the parent. I am back at square one. What is less resource consuming (for
IIS) ?
FSO or XMLHTTP ?

I know that the former will return text/html processed by whatever server
delivers the file, but what about FSO, when the file has ASP code? Will the
script run and the text/html output returned?
 
M

Mark Schupp

FSO will return the raw ASP script text. XMLHTTP will return the output of
the ASP page as if it were loaded from the web-server into a browser.

If you give more details about what you are trying to do someone may be able
to suggest a different approach.
 
C

Chris Hohmann

Pietro said:
That's all very limiting. I tried passing variables to the page called
with
server.execute in a querystring, and got an error when loading the parent
page.

" Invalid URL form or fully-qualified absolute URL was used. Use relative
URLs. "

Oh, well.
You could use the Application/Session scope to share variables between
caller and callee pages when using Server.Execute/Server.Transfer. Make sure
to clean up after yourself and only store simple variables or threadsafe
objects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top