In Classic ASP, how do you detect on that the page got control via a Server.Transfer()?
I cannot compare the URL vs the current ASP filename because the code is stored in a library (included).
In Classic ASP, how do you detect on that the page got control via a Server.Transfer()?
I cannot compare the URL vs the current ASP filename because the code is stored in a library (included).
You can check if Request.ServerVariables("URL")
matches the current page. For a Server.Transfer the URL is still the original page that was requested.
In response to your edit: The page needs to provide the current page name to the code in the library, otherwise the library has nothing that it can compare the requested URL to.
There is no way to acheive this without some assistance from the page calling Transfer or the page to which execution is transfered. Probably the latter would be the best place to do this and tweak the library code to accept details from it about the transfer (if any).