To get the url of the current page, I usually do something like this:
string path = Request.Path;
If I do this after a Server.Transfer then I get the path of the page where the transfer was done. How can I get it for the current page?
For example:
On Page1.aspx I do Server.Transfer ("Page2.aspx")
On Page2.aspx Request.Path returns /Page1.aspx and not /Page2.aspx
I would like to get /Page2.aspx. How can I get it?
The Response. Redirect method redirects a request to a new URL and specifies the new URL while the Server. Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page.
Transfer(String, Boolean) Terminates execution of the current page and starts execution of a new page by using the specified URL path of the page.
Server data transfer (SDT) is a server-side delivery method for transferring user data from the Oracle Data Cloud platform into your system. After an ID swap has been performed on a user, the platform can deliver data on that user to your server-side profile store — without firing a pixel.
Server. Transfer() should be used when: we want to transfer current page request to another . aspx page on the same server. we want to preserve server resources and avoid the unnecessary roundtrips to the server.
You're looking for the Request.CurrentExecutionFilePath
property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With