SSI/ASP PROBLEM (Query String) HELP!!!

Discussion in 'ASP General' started by Jeremy, Dec 11, 2003.

  1. Jeremy

    Jeremy Guest

    I'm posting my message again since I've received 0 replies the first time.


    In IIS5 with ASP when I try to run an SSI command:

    <!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->

    I get "404 Object Not Found" But if I remove the query string like so:

    <!--#include virtual="/asp_scripts/template.asp" -->

    It works just fine.

    Any ideas on how to fix this problem? Time is of the essence and I
    really appreciate your time and responses.

    Thanks,
    Jeremy
     
    Jeremy, Dec 11, 2003
    #1
    1. Advertising

  2. Jeremy

    Tim Slattery Guest

    (Jeremy) wrote:

    >I'm posting my message again since I've received 0 replies the first time.
    >
    >
    >In IIS5 with ASP when I try to run an SSI command:
    >
    ><!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->
    >
    >I get "404 Object Not Found" But if I remove the query string like so:


    I'm a bit surprised at the message, but not at the fact that this
    doesn't work. The "include" directive just reads another file and
    plunks it into the file currently being worked on. It does not make a
    web request, which is what you are trying to do here. This simply will
    not work.

    --
    Tim Slattery
    MS MVP(DTS)
     
    Tim Slattery, Dec 11, 2003
    #2
    1. Advertising

  3. Jeremy

    Bob Barrows Guest

    Jeremy wrote:
    > I'm posting my message again since I've received 0 replies the first
    > time.
    >
    >
    > In IIS5 with ASP when I try to run an SSI command:
    >
    > <!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main"
    > -->
    >
    > I get "404 Object Not Found" But if I remove the query string like so:
    >
    > <!--#include virtual="/asp_scripts/template.asp" -->
    >
    > It works just fine.


    This is expected. Code in an Included page has access to the querystring of
    the page in which it is Included. If the required values are not part of the
    request collection of that page, then you need to use global variables in
    that page which are referenced in the code in the Included page:

    <%
    dim strsection, strsub
    strsection=1
    strsub="Main"
    %>

    In template.asp, instead of using
    request.querystring("section")

    use

    strsection

    HTH,
    Bob Barrows



    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows, Dec 11, 2003
    #3
  4. Jeremy

    Jeremy Capp Guest

    Thanks, Bob, for the reply. I guess I'm just going to have to change all
    my .shtml files to .asp files so I can create these variables.

    It sucks that ASP/IIS doesn't allow this.....putting query strings that
    include CGI/Perl scripts via SSI works just fine.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jeremy Capp, Dec 11, 2003
    #4
  5. Jeremy

    Jeremy Capp Guest

    Tim,

    I appreciate the reply. However, I've been programming in Perl for
    many years and putting a query string into an include ALWAYS worked. I
    guess ASP just sucks and I'll have to change all my .shtml files to .asp
    files so I can create the variables to pass to the script I'm trying to
    call.

    Thanks again.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jeremy Capp, Dec 11, 2003
    #5
  6. Jeremy

    Tim Slattery Guest

    Jeremy Capp <> wrote:

    >Tim,
    >
    > I appreciate the reply. However, I've been programming in Perl for
    >many years and putting a query string into an include ALWAYS worked. I
    >guess ASP just sucks and I'll have to change all my .shtml files to .asp
    >files so I can create the variables to pass to the script I'm trying to
    >call.


    The SSI facility in ASP is *not* the same as anything in Perl, I'm
    certain of that!

    I know Perl, but I don't know of an "include" facility in that
    language. I assume that you actually were submitting a web request and
    catching the result in your Perl code. As you now know, ASP's
    "include" doesn't work like that.

    --
    Tim Slattery
    MS MVP(DTS)
     
    Tim Slattery, Dec 11, 2003
    #6
    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. SpaceGirl

    Parse querry string with ssi

    SpaceGirl, May 22, 2004, in forum: HTML
    Replies:
    2
    Views:
    1,187
    Martin Johansen
    May 23, 2004
  2. worldboy

    ssi and query strings

    worldboy, Sep 21, 2004, in forum: HTML
    Replies:
    0
    Views:
    448
    worldboy
    Sep 21, 2004
  3. shland

    ASP and IIS and SSI...please help

    shland, Sep 22, 2003, in forum: ASP General
    Replies:
    3
    Views:
    146
    Ray at
    Sep 23, 2003
  4. Jeremy

    SSI/ASP 404 Error (Query String)

    Jeremy, Dec 9, 2003, in forum: ASP General
    Replies:
    0
    Views:
    137
    Jeremy
    Dec 9, 2003
  5. nick
    Replies:
    1
    Views:
    462
    David Mark
    Feb 13, 2011
Loading...

Share This Page