Know Page Name with ServerTransfer

Discussion in 'ASP .Net' started by Manuel Lopez, Feb 25, 2004.

  1. Manuel Lopez

    Manuel Lopez Guest

    Hello,

    I need to know on evry request the page name, my problem is when use
    the method server.transfer, i always get the name of the calling page.

    I use context.Current.Request.Url, but I am always getting the first
    page.

    Is there a way to get the name of the transfered page?

    Thanks,
    Manuel
    Manuel Lopez, Feb 25, 2004
    #1
    1. Advertising

  2. Try rather the Script_Name server variables.

    The Url is rather the exact url requested (which doesn't change wehn using
    Server.Transfer) while Script_Name should be always IMO the current file...

    --

    "Manuel Lopez" <> a écrit dans le message de
    news:...
    > Hello,
    >
    > I need to know on evry request the page name, my problem is when use
    > the method server.transfer, i always get the name of the calling page.
    >
    > I use context.Current.Request.Url, but I am always getting the first
    > page.
    >
    > Is there a way to get the name of the transfered page?
    >
    > Thanks,
    > Manuel
    Patrice Scribe, Feb 25, 2004
    #2
    1. Advertising

  3. Manuel Lopez

    Manuel Lopez Guest

    Hello Patrice thanks for your reply,

    I have tried using Request.ServerVariables("Script_Name") and I get
    the same behavior when using server.transfer I always get the calling
    page.

    There must be a way to the name of the page that is being executed?

    Many Thanks,
    Angel

    "Patrice Scribe" <> wrote in message news:<eT5Rbo5#>...
    > Try rather the Script_Name server variables.
    >
    > The Url is rather the exact url requested (which doesn't change wehn using
    > Server.Transfer) while Script_Name should be always IMO the current file...
    >
    > --
    >
    > "Manuel Lopez" <> a écrit dans le message de
    > news:...
    > > Hello,
    > >
    > > I need to know on evry request the page name, my problem is when use
    > > the method server.transfer, i always get the name of the calling page.
    > >
    > > I use context.Current.Request.Url, but I am always getting the first
    > > page.
    > >
    > > Is there a way to get the name of the transfered page?
    > >
    > > Thanks,
    > > Manuel
    Manuel Lopez, Feb 26, 2004
    #3
  4. Should have thought about that as it's taken from the original HTTP request
    I suppose. The only option I can see is to query for the current class using
    reflection or something similar.

    I would recommend not using Server.Transfer for navigation purpose but
    rather only when, for some reason, you have a processing only page that
    logically "belongs" to the calling navigation page.

    Patrice


    --

    "Manuel Lopez" <> a écrit dans le message de
    news:...
    > Hello Patrice thanks for your reply,
    >
    > I have tried using Request.ServerVariables("Script_Name") and I get
    > the same behavior when using server.transfer I always get the calling
    > page.
    >
    > There must be a way to the name of the page that is being executed?
    >
    > Many Thanks,
    > Angel
    >
    > "Patrice Scribe" <> wrote in message

    news:<eT5Rbo5#>...
    > > Try rather the Script_Name server variables.
    > >
    > > The Url is rather the exact url requested (which doesn't change wehn

    using
    > > Server.Transfer) while Script_Name should be always IMO the current

    file...
    > >
    > > --
    > >
    > > "Manuel Lopez" <> a écrit dans le message de
    > > news:...
    > > > Hello,
    > > >
    > > > I need to know on evry request the page name, my problem is when use
    > > > the method server.transfer, i always get the name of the calling page.
    > > >
    > > > I use context.Current.Request.Url, but I am always getting the first
    > > > page.
    > > >
    > > > Is there a way to get the name of the transfered page?
    > > >
    > > > Thanks,
    > > > Manuel
    Patrice Scribe, Feb 27, 2004
    #4
  5. Request.CurrentExecutionFilePath does the job...

    Patrice

    --

    "Manuel Lopez" <> a écrit dans le message de
    news:...
    > Hello Patrice thanks for your reply,
    >
    > I have tried using Request.ServerVariables("Script_Name") and I get
    > the same behavior when using server.transfer I always get the calling
    > page.
    >
    > There must be a way to the name of the page that is being executed?
    >
    > Many Thanks,
    > Angel
    >
    > "Patrice Scribe" <> wrote in message

    news:<eT5Rbo5#>...
    > > Try rather the Script_Name server variables.
    > >
    > > The Url is rather the exact url requested (which doesn't change wehn

    using
    > > Server.Transfer) while Script_Name should be always IMO the current

    file...
    > >
    > > --
    > >
    > > "Manuel Lopez" <> a écrit dans le message de
    > > news:...
    > > > Hello,
    > > >
    > > > I need to know on evry request the page name, my problem is when use
    > > > the method server.transfer, i always get the name of the calling page.
    > > >
    > > > I use context.Current.Request.Url, but I am always getting the first
    > > > page.
    > > >
    > > > Is there a way to get the name of the transfered page?
    > > >
    > > > Thanks,
    > > > Manuel
    Patrice Scribe, Mar 1, 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. DP
    Replies:
    0
    Views:
    1,130
  2. ad

    How to know the page name

    ad, Feb 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    320
  3. Lasse Laegteskov
    Replies:
    1
    Views:
    483
    Rune Berge
    Jun 1, 2004
  4. Replies:
    2
    Views:
    279
    Victor Bazarov
    Jan 25, 2007
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    220
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page