Obtaining page path when using Server.Transfer...

Discussion in 'ASP .Net' started by Terry Mulvany, Apr 30, 2004.

  1. Grettings,
    Normally I can use Request.RawUrl to get the 'current' page (amongst many
    other things). But in the case of using a Server.Transfer
    [as in Server.Transfer(bar.aspx) from foo.aspx, my RawUrl is still showing
    foo.aspx (understandably) because a 'request' is not being made per say.
    But my problem is that I have a 'basepage' that needs to know the current
    page, even if the page is being loaded via a server.transfer... any ideas?
    Note: It's not just the page name [bar.aspx] but the path from the root of
    the site [or virtual dir.]. So if foo.aspx server.transfer()ed to
    http://www.domain.com/somefolder/bar.aspx I need '/somefolder/bar.aspx'.
    Thanks in advance.
     
    Terry Mulvany, Apr 30, 2004
    #1
    1. Advertising

  2. Terry Mulvany

    Chris Moore Guest

    Have you considered using a Response.Redirect() rather than a
    Server.Transfer()? I don't know if that would work with your current
    architecture, but it would solve the page name problem.

    Chris
    --------------------
    >From: "Terry Mulvany" <>
    >Subject: Obtaining page path when using Server.Transfer...
    >Date: Fri, 30 Apr 2004 11:35:52 -0700
    >Lines: 13
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
    >Message-ID: <#>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >NNTP-Posting-Host: user-119bsue.biz.mindspring.com 66.149.243.206
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
    .phx.gbl
    >Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet:230326
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >Grettings,
    >Normally I can use Request.RawUrl to get the 'current' page (amongst many
    >other things). But in the case of using a Server.Transfer
    >[as in Server.Transfer(bar.aspx) from foo.aspx, my RawUrl is still showing
    >foo.aspx (understandably) because a 'request' is not being made per say.
    >But my problem is that I have a 'basepage' that needs to know the current
    >page, even if the page is being loaded via a server.transfer... any ideas?
    >Note: It's not just the page name [bar.aspx] but the path from the root of
    >the site [or virtual dir.]. So if foo.aspx server.transfer()ed to
    >http://www.domain.com/somefolder/bar.aspx I need '/somefolder/bar.aspx'.
    >Thanks in advance.
    >
    >
    >
     
    Chris Moore, Apr 30, 2004
    #2
    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. Aaron
    Replies:
    0
    Views:
    675
    Aaron
    Jun 14, 2004
  2. gh0st54
    Replies:
    6
    Views:
    8,209
    Natty Gur
    Aug 19, 2003
  3. RVince
    Replies:
    9
    Views:
    439
    Dave Angel
    May 25, 2011
  4. Kevin Vogler

    Server.Transfer and image path

    Kevin Vogler, Aug 3, 2003, in forum: ASP General
    Replies:
    5
    Views:
    156
  5. Jim
    Replies:
    1
    Views:
    988
    Aaron Bertrand - MVP
    Jan 28, 2004
Loading...

Share This Page