|
|
| Pietro 2005-06-10, 3:55 pm |
| 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.
| |
| Ray Costanzo [MVP] 2005-06-10, 3:55 pm |
| What about server.execute? Is that an option for you?
Ray at work
"Pietro" <peterpan@nowhere.com> wrote in message
news:o7iqe.15045$Nd3.796403@news20.bellglobal.com...
> 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.
>
>
| |
| Sylvain Lafontaine 2005-06-10, 3:55 pm |
| 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/d...pting091399.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.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Pietro" <peterpan@nowhere.com> wrote in message
news:o7iqe.15045$Nd3.796403@news20.bellglobal.com...
> 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.
>
>
| |
| Pietro 2005-06-10, 3:55 pm |
| "Ray Costanzo [MVP]" wrote :
> What about server.execute? Is that an option for you?
YES! How did I miss that feature? Shame on me ...
| |
| Pietro 2005-06-10, 3:55 pm |
| 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.
| |
| Ray Costanzo [MVP] 2005-06-10, 8:55 pm |
| 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
"Pietro" <peterpan@nowhere.com> wrote in message
news:r%jqe.16038$_n2.1222486@news20.bellglobal.com...
> 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.
>
>
| |
| Pietro 2005-06-11, 3:55 am |
| 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.
| |
| Pietro 2005-06-11, 3:55 am |
| 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?
|
|
|
|