Know Page Name with ServerTransfer

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
 
P

Patrice Scribe

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

Manuel Lopez

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
 
P

Patrice Scribe

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


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top