I have a feeling I'm using HttpContext.Current incorrectly, based on some strange code output.
I have two pages, http://example.com/Foo.aspx, and http://example.com/Bar.aspx. Both have a button that, when clicked, calls a static function in a class outside of the Page's context that emails me System.Web.HttpContext.Current.Request.Url.AbsolutePath as that static function sees it.
I would expect that when the button on Foo.aspx is sent, it would email me "/Foo.aspx" ... and usually it does. We noticed one time where that call from Foo.aspx sent us "/Bar.aspx" unexpectedly.
Both pages could have conceivably been loaded by the same client.
- What's going on here? How does HttpContext.Current.Request return a different path than the page that called the static function that references it?
- How can I get what I want - i.e., unfailingly get the absolute path of the page that called the static function that cares about it?