variable in include file

Discussion in 'ASP General' started by Frank, Jan 22, 2004.

  1. Frank

    Frank Guest

    Hi,
    It is possible to add variable into the include file.

    <!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->

    strfoldername is from my database.
    It doesn't work.
    Anyone knows how to solve this problem.
    Or has other way to do it.
    Thanks,
    Frank
     
    Frank, Jan 22, 2004
    #1
    1. Advertising

  2. Frank

    Ray at Guest

    Includes are processed prior to any code. Read here.

    http://www.aspfaq.com/show.asp?id=2042

    Ray at work

    "Frank" <> wrote in message
    news:...
    > Hi,
    > It is possible to add variable into the include file.
    >
    > <!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->
    >
    > strfoldername is from my database.
    > It doesn't work.
    > Anyone knows how to solve this problem.
    > Or has other way to do it.
    > Thanks,
    > Frank
    >
    >
    >
     
    Ray at, Jan 22, 2004
    #2
    1. Advertising

  3. Frank

    MePadre Guest

    Include files are 'Included' before the page is
    processed. With this in mind, you can not use a variable
    to define the location of the include file as that
    variable does not exist when the server is doing its
    initial run-through of code.

    You may be able to use server.transfer or server.execute
    as an option.

    >-----Original Message-----
    >Hi,
    >It is possible to add variable into the include file.
    >
    ><!--#include file="../info/<%=strfoldername%
    >/notetosomeone.asp"-->
    >
    >strfoldername is from my database.
    >It doesn't work.
    >Anyone knows how to solve this problem.
    >Or has other way to do it.
    >Thanks,
    >Frank
    >
    >
    >
    >.
    >
     
    MePadre, Jan 22, 2004
    #3
  4. Frank

    Curt_C [MVP] Guest

    no

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "Frank" <> wrote in message
    news:...
    > Hi,
    > It is possible to add variable into the include file.
    >
    > <!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->
    >
    > strfoldername is from my database.
    > It doesn't work.
    > Anyone knows how to solve this problem.
    > Or has other way to do it.
    > Thanks,
    > Frank
    >
    >
    >
     
    Curt_C [MVP], Jan 22, 2004
    #4
  5. No, you can't do this.
    http://www.aspfaq.com/2042

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Frank" <> wrote in message
    news:...
    > Hi,
    > It is possible to add variable into the include file.
    >
    > <!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->
    >
    > strfoldername is from my database.
    > It doesn't work.
    > Anyone knows how to solve this problem.
    > Or has other way to do it.
    > Thanks,
    > Frank
    >
    >
    >
     
    Aaron Bertrand - MVP, Jan 22, 2004
    #5
    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. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    549
    Exits Funnel
    Mar 6, 2005
  2. PTM
    Replies:
    1
    Views:
    340
    Andy Dingley
    Nov 12, 2007
  3. naveeddil
    Replies:
    0
    Views:
    590
    naveeddil
    Jan 4, 2008
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    957
    Andreas Bogenberger
    Feb 22, 2008
  5. Eric
    Replies:
    10
    Views:
    483
Loading...

Share This Page