Pass Parameters to <!-- #Include File="file.asp" -->

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vunet.us@gmail.com

    Pass Parameters to <!-- #Include File="file.asp" -->

    What is the workaround of passign a parameter to any included asp
    file:

    <!-- #Include File="file.asp" -->

    This obviously does not work:

    <!-- #Include File="file.asp? id=123" -->

    Thank you

  • Jon Paal [MSMD]

    #2
    Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

    Server.Execute Method

    The Execute method calls an .asp file, and processes it as if it were part of the calling ASP script. The Execute method is similar
    to a procedure call in many programming languages.







    <vunet.us@gmail .comwrote in message news:1175617499 .385520.188400@ n76g2000hsh.goo glegroups.com.. .
    What is the workaround of passign a parameter to any included asp
    file:
    >
    <!-- #Include File="file.asp" -->
    >
    This obviously does not work:
    >
    <!-- #Include File="file.asp? id=123" -->
    >
    Thank you
    >

    Comment

    • vunet.us@gmail.com

      #3
      Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

      On Apr 3, 12:45 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
      dot comwrote:
      Server.Execute Method
      >
      The Execute method calls an .asp file, and processes it as if it were part of the calling ASP script. The Execute method is similar
      to a procedure call in many programming languages.
      >

      >
      <vunet...@gmail .comwrote in messagenews:117 5617499.385520. 188400@n76g2000 hsh.googlegroup s.com...
      What is the workaround of passign a parameter to any included asp
      file:
      >
      <!-- #Include File="file.asp" -->
      >
      This obviously does not work:
      >
      <!-- #Include File="file.asp? id=123" -->
      >
      Thank you
      so will this work?: Server.Execute myfile.asp?id=1 23

      Comment

      • Jon Paal [MSMD]

        #4
        Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

        no, you don't need to pass anything through.

        The external file is processes information as though it is part of the originating file.

        Therefore any values in the originating file (id=123) can be used by the external file.


        Comment

        • vunet.us@gmail.com

          #5
          Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

          On Apr 3, 1:22 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
          comwrote:
          no, you don't need to pass anything through.
          >
          The external file is processes information as though it is part of the originating file.
          >
          Therefore any values in the originating file (id=123) can be used by the external file.
          Do you say I cannot use params at all?

          Comment

          • Jon Paal [MSMD]

            #6
            Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

            params aren't required with this solution, please read the instructions for usage at the site link provided.





            <vunet.us@gmail .comwrote in message news:1175624771 .487195.216760@ b75g2000hsg.goo glegroups.com.. .
            On Apr 3, 1:22 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
            comwrote:
            >no, you don't need to pass anything through.
            >>
            >The external file is processes information as though it is part of the originating file.
            >>
            >Therefore any values in the originating file (id=123) can be used by the external file.
            >
            Do you say I cannot use params at all?
            >

            Comment

            • Anthony Jones

              #7
              Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;


              <vunet.us@gmail .comwrote in message
              news:1175617499 .385520.188400@ n76g2000hsh.goo glegroups.com.. .
              What is the workaround of passign a parameter to any included asp
              file:
              >
              <!-- #Include File="file.asp" -->
              >
              This obviously does not work:
              >
              <!-- #Include File="file.asp? id=123" -->
              >
              Thank you
              >
              Is the file being included expecting to be able to read parameters from the
              querystring?
              Can it be independantly visited by the client or is it always intended to be
              an include?


              Comment

              • vunet.us@gmail.com

                #8
                Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

                On Apr 3, 4:15 pm, "Anthony Jones" <A...@yadayaday ada.comwrote:
                <vunet...@gmail .comwrote in message
                >
                news:1175617499 .385520.188400@ n76g2000hsh.goo glegroups.com.. .
                >
                What is the workaround of passign a parameter to any included asp
                file:
                >
                <!-- #Include File="file.asp" -->
                >
                This obviously does not work:
                >
                <!-- #Include File="file.asp? id=123" -->
                >
                Thank you
                >
                Is the file being included expecting to be able to read parameters from the
                querystring?
                Can it be independantly visited by the client or is it always intended to be
                an include?
                i've decided using this strategy:
                dim id : id=123
                <!-- #Include File="file.asp" -->
                id=321
                <!-- #Include File="file.asp" -->

                where file.asp will assign id value to appropriate object.
                yes, i do need to use some kind of include method

                Comment

                • Dave Anderson

                  #9
                  Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

                  vunet.us@gmail. com wrote:
                  i've decided using this strategy:
                  dim id : id=123
                  <!-- #Include File="file.asp" -->
                  id=321
                  <!-- #Include File="file.asp" -->
                  >
                  where file.asp will assign id value to appropriate object.
                  yes, i do need to use some kind of include method
                  This is an especially inefficient way to use include files. You would be
                  better served by putting the applicable parts of the include into a Sub or
                  Function, then call them with the respective IDs:

                  [------- Begin file.asp ----------]
                  Sub DoStuff(id)
                  { your included code goes here }
                  End Sub
                  [-------- End file.asp -----------]

                  As long as everything in the include is in functions or subroutines, you can
                  place it anywhere in your document and make the calls where you need them.




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

                  • vunet.us@gmail.com

                    #10
                    Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

                    On Apr 3, 6:06 pm, "Dave Anderson" <NYRUMTPEL...@s pammotel.comwro te:
                    vunet...@gmail. com wrote:
                    i've decided using this strategy:
                    dim id : id=123
                    <!-- #Include File="file.asp" -->
                    id=321
                    <!-- #Include File="file.asp" -->
                    >
                    where file.asp will assign id value to appropriate object.
                    yes, i do need to use some kind of include method
                    >
                    This is an especially inefficient way to use include files. You would be
                    better served by putting the applicable parts of the include into a Sub or
                    Function, then call them with the respective IDs:
                    >
                    [------- Begin file.asp ----------]
                    Sub DoStuff(id)
                    { your included code goes here }
                    End Sub
                    [-------- End file.asp -----------]
                    >
                    As long as everything in the include is in functions or subroutines, you can
                    place it anywhere in your document and make the calls where you need them.
                    >
                    --
                    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.
                    so if I have 4 pages I normally "include" now, you suggest to combine
                    them into one page each within a sub? that will be a loooong code
                    page. what is "inefficien t" about my method above? i understand that
                    may not be the best way, but i want to know how it make things worse.

                    Comment

                    • Dave Anderson

                      #11
                      Re: Pass Parameters to &lt;!-- #Include File=&quot;file .asp&quot; --&gt;

                      vunet.us@gmail. com wrote:
                      so if I have 4 pages I normally "include" now, you suggest to
                      combine them into one page each within a sub?
                      Not at all. I am saying there is almost never a benefit to including the
                      same file twice in the same script. To extend my example to your original
                      one, instead of this...

                      dim id : id=123
                      <!-- #Include File="file.asp" -->
                      id=321
                      <!-- #Include File="file.asp" -->

                      ....use this:

                      <!-- #Include File="file.asp" --(with Sub defined)
                      DoStuff 123
                      DoStuff 321

                      what is "inefficien t" about my method above? i understand that
                      may not be the best way, but i want to know how it make things
                      worse.
                      The parser will fetch a copy of the included file for each #include
                      statement and splice it into the script before parsing a sigle line of
                      VBScript. Your approach could add a tremendous amount of redundancy.

                      As for your concerns about the length of code, my suggestion actually
                      shortens it.



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