Know Page Name with ServerTransfer

  • Thread starter Thread starter Manuel Lopez
  • Start date Start date
M

Manuel Lopez

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
 
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...
 
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
 
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


--
 
Back
Top