querystring variables in #include files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Todd

    querystring variables in #include files

    Hello...I'm trying to include querystring variables in a #include but it's
    not working

    this works:

    <!--#include file="calendar/calendar.asp-->

    this does not:

    <!--#include
    file="calendar/calendar.asp?ev enttype=1&curmo nth=8&curyear=2 006"-->

    any suggestions.

    Thank You
  • Evertjan.

    #2
    Re: querystring variables in #include files

    =?Utf-8?B?VG9kZA==?= wrote on 11 aug 2006 in
    microsoft.publi c.inetserver.as p.general:
    Hello...I'm trying to include querystring variables in a #include but
    it's not working
    >
    this works:
    >
    <!--#include file="calendar/calendar.asp-->
    >
    this does not:
    >
    <!--#include
    file="calendar/calendar.asp?ev enttype=1&curmo nth=8&curyear=2 006"-->
    The second would have no sense, since the <!--#include only inserts the
    litteral content of the file, whatever it's extension[!!!], in the calling
    file, and does not execute by itself.

    This litteral content can be asp code or any other and is,
    if it is asp code only executed as part of the "include calling" page.

    Why do we often stress include called pages should have a .asp extension?

    Because with another extension, say: .txt, .inc, .html, if the page were
    accessable from the internet, it's content could be read by anyone.

    So request.queryst ring("eventtype ") will only return what is in the main
    ..asp page, even if this [part of code is in the included file.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • Dave Anderson

      #3
      Re: querystring variables in #include files

      Todd wrote:
      Hello...I'm trying to include querystring variables in a
      #include but it's not working
      Patient: Doctor, it hurts when I do this
      Doctor: Then don't do that

      Seriously, there is no way to do what you suggest. The included file is
      treated like a script fragment and shares form & querystring information
      with the enclosing document. In fact, the entire document is parsed as one
      document ONLY AFTER all of the include files are assembled.


      I suspect from your example that you might get what you want from
      Server.Execute( )




      --
      Dave Anderson

      Unsolicited commercial email will be read at a cost of $500 per message. Use
      of this email address implies consent to these terms.


      Comment

      • Todd

        #4
        Re: querystring variables in #include files

        Thank you...yes..I forgot about how it works

        "Dave Anderson" wrote:
        Todd wrote:
        Hello...I'm trying to include querystring variables in a
        #include but it's not working
        >
        Patient: Doctor, it hurts when I do this
        Doctor: Then don't do that
        >
        Seriously, there is no way to do what you suggest. The included file is
        treated like a script fragment and shares form & querystring information
        with the enclosing document. In fact, the entire document is parsed as one
        document ONLY AFTER all of the include files are assembled.

        >
        I suspect from your example that you might get what you want from
        Server.Execute( )

        >
        >
        >
        --
        Dave Anderson
        >
        Unsolicited commercial email will be read at a cost of $500 per message. Use
        of this email address implies consent to these terms.
        >
        >
        >

        Comment

        Working...