detecting page name

Discussion in 'ASP General' started by Gav, Jan 3, 2004.

  1. Gav

    Gav Guest

    Quick simple question...

    how do u detect what the current pagename is (i.e. page.asp). also if the
    command is stored in the include will it return the include file name or the
    page that the command is included in name?

    cheers
    gavin
    Gav, Jan 3, 2004
    #1
    1. Advertising

  2. Gav

    only_me Guest

    Look up "request.servervariables()"

    "Gav" <> wrote in message
    news:CMzJb.1272$...
    > Quick simple question...
    >
    > how do u detect what the current pagename is (i.e. page.asp). also if the
    > command is stored in the include will it return the include file name or

    the
    > page that the command is included in name?
    >
    > cheers
    > gavin
    >
    >
    only_me, Jan 3, 2004
    #2
    1. Advertising

  3. Gav

    Brynn Guest

    <%

    page = Request.ServerVariables("Script_Name")

    '// this will give you the path to the file you are on ... link
    '// yourfolder/yourfile.asp

    %>

    And it will give you the page you are on, NOT the include file ... I
    can't think of a way with ASP that will give you the include file ...
    only way would be to have a variable on it that is read later

    On Sat, 3 Jan 2004 13:50:17 -0000, "Gav" <> wrote:

    >Quick simple question...
    >
    >how do u detect what the current pagename is (i.e. page.asp). also if the
    >command is stored in the include will it return the include file name or the
    >page that the command is included in name?
    >
    >cheers
    >gavin
    >
    >
    Brynn, Jan 3, 2004
    #3
  4. Gav

    Gav Guest

    Hi,
    Thats done the trick,
    thanks mate

    gav

    "Brynn" <> wrote in message
    news:...
    > <%
    >
    > page = Request.ServerVariables("Script_Name")
    >
    > '// this will give you the path to the file you are on ... link
    > '// yourfolder/yourfile.asp
    >
    > %>
    >
    > And it will give you the page you are on, NOT the include file ... I
    > can't think of a way with ASP that will give you the include file ...
    > only way would be to have a variable on it that is read later
    >
    > On Sat, 3 Jan 2004 13:50:17 -0000, "Gav" <> wrote:
    >
    > >Quick simple question...
    > >
    > >how do u detect what the current pagename is (i.e. page.asp). also if the
    > >command is stored in the include will it return the include file name or

    the
    > >page that the command is included in name?
    > >
    > >cheers
    > >gavin
    > >
    > >

    >
    Gav, Jan 4, 2004
    #4
    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. Replies:
    0
    Views:
    450
  2. =?iso-8859-1?B?bW9vcJk=?=
    Replies:
    7
    Views:
    817
    Roedy Green
    Jan 2, 2006
  3. ding feng
    Replies:
    2
    Views:
    2,801
    ding feng
    Jun 25, 2003
  4. Bobby Chamness
    Replies:
    2
    Views:
    2,387
    Joe Smith
    Apr 22, 2007
  5. Jeff
    Replies:
    2
    Views:
    337
    Eliyahu Goldin
    May 28, 2007
Loading...

Share This Page