get the name of the current page

Discussion in 'ASP General' started by JT, Jan 15, 2004.

  1. JT

    JT Guest

    is there a command in asp to get the name of the current page?

    furthermore, is there a way to retrieve the name of the current page within
    an 'included' file (not the name of the included page, but the name of the
    page that is including the file)?

    i hope im making sense

    thanks for the help
     
    JT, Jan 15, 2004
    #1
    1. Advertising

  2. JT

    Ray at Guest

    Take a look at the server variables that are available to you:

    <%
    For each q in Request.ServerVariables
    Response.Write q & " = " Request.ServerVariables(q) & "<hr>"
    Next
    %>

    Ray at work

    "JT" <> wrote in message
    news:...
    > is there a command in asp to get the name of the current page?
    >
    > furthermore, is there a way to retrieve the name of the current page

    within
    > an 'included' file (not the name of the included page, but the name of the
    > page that is including the file)?
    >
    > i hope im making sense
    >
    > thanks for the help
    >
    >
     
    Ray at, Jan 15, 2004
    #2
    1. Advertising

  3. http://www.aspfaq.com/2072

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




    "JT" <> wrote in message
    news:...
    > is there a command in asp to get the name of the current page?
    >
    > furthermore, is there a way to retrieve the name of the current page

    within
    > an 'included' file (not the name of the included page, but the name of the
    > page that is including the file)?
    >
    > i hope im making sense
    >
    > thanks for the help
    >
    >
     
    Aaron Bertrand - MVP, Jan 15, 2004
    #3
  4. Hi,

    If you want just the name of the current file:

    request.servervariables("PATH_INFO")

    If you want the whole URL to the file returned:

    xyz = "http://" & request.servervariables("LOCAL_ADDR") & _
    request.servervariables("PATH_INFO")

    HTH.

    JT, on Thu, 15 Jan 2004 09:54:53 -0600, had to say:

    > is there a command in asp to get the name of the current page?
    >
    > furthermore, is there a way to retrieve the name of the current page within
    > an 'included' file (not the name of the included page, but the name of the
    > page that is including the file)?
    >
    > i hope im making sense
    >
    > thanks for the help
     
    Mikhail Esteves, Jan 15, 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. IntraRELY

    Get the name of the current page

    IntraRELY, Jul 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,844
    niceguy
    Jul 31, 2003
  2. ding feng
    Replies:
    2
    Views:
    2,820
    ding feng
    Jun 25, 2003
  3. VB Programmer
    Replies:
    11
    Views:
    16,331
    JestersTears
    Jun 21, 2010
  4. Matthew Heidemann
    Replies:
    14
    Views:
    247
    eT Ma
    Mar 22, 2011
  5. Replies:
    3
    Views:
    385
Loading...

Share This Page