FSO or XMLHTTP

Discussion in 'ASP General' started by Pietro, Jun 10, 2005.

  1. Pietro

    Pietro Guest

    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, Jun 10, 2005
    #1
    1. Advertising

  2. What about server.execute? Is that an option for you?

    Ray at work

    "Pietro" <> wrote in message
    news:eek:7iqe.15045$...
    > 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], Jun 10, 2005
    #2
    1. Advertising

  3. 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.

    --
    Sylvain Lafontaine, ing.
    MVP - Technologies Virtual-PC
    E-mail: http://cerbermail.com/?QugbLEWINF


    "Pietro" <> wrote in message
    news:eek:7iqe.15045$...
    > 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, Jun 10, 2005
    #3
  4. Pietro

    Pietro Guest

    "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, Jun 10, 2005
    #4
  5. Pietro

    Pietro Guest

    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, Jun 10, 2005
    #5
  6. 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" <> wrote in message
    news:r%jqe.16038$...
    > 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], Jun 10, 2005
    #6
  7. Pietro

    Pietro Guest

    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, Jun 11, 2005
    #7
  8. Pietro

    Pietro Guest

    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?
     
    Pietro, Jun 11, 2005
    #8
  9. Pietro

    Mark Schupp Guest

    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.

    --
    Mark Schupp



    "Pietro" <> wrote in message
    news:fNpqe.15261$...
    > 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?
    >
    >
     
    Mark Schupp, Jun 13, 2005
    #9
  10. "Pietro" <> wrote in message
    news:6ypqe.15253$...
    > 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.
     
    Chris Hohmann, Jun 13, 2005
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KEN

    ASP FSO File Name Problem

    KEN, Jul 25, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Peter Bucher [MVP]
    Jul 26, 2007
  2. NIck
    Replies:
    0
    Views:
    121
  3. Paul

    fso tutorial

    Paul, Jul 17, 2003, in forum: ASP General
    Replies:
    3
    Views:
    118
    Jeff Cochran
    Jul 17, 2003
  4. Steven Burn

    FSO + XMLHTTP + reading large files + errr....

    Steven Burn, May 22, 2005, in forum: ASP General
    Replies:
    3
    Views:
    253
    Steven Burn
    May 23, 2005
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    423
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page