Hi,
For this, you can use a
HttpModule
which will handle every request to your page. There you can implement your functionality (check from where the user is coming, which URL he requested and so on..).
Here is a Example from Microsoft (don't bother about the .net Version, as far as I see there should be nothing wrong in the example):
http://msdn.microsoft.com/en-us/library/aa719858%28v=vs.71%29.aspx[
^]
Also I some month ago I wrote a blog entry about a URL rewriter (this does mostly the same ;)):
http://blog.dotnetcorner.ch/post/2011/03/30/How-to-Create-an-easy-and-flexible-URL-Rewriter.aspx[
^]
Hope this helps.
Best regards and happy coding,
Chris