This is one that bit me the other day and re-enforces the need to think about why you use a certain method.  I was doing some testing at the client I am working at and a page suddenly started rendering twice in the same browser window.  So what I ended up with was:

My Page


My Page

Now how the heck can that happen?  I was a victum of my own code.  The application's detail page was catching a custom exception type and then using Server.Transfer to go to an overview page.  No problem, right? 

The problem is that calling Server.Transfer causes a ThreadAbortException in the originating page.  After the custom exception was caught and the page was transferred and the new page completed its load the thread abort was caught by the original page looking for any System.Exception errors.  Guess what was being performed in this catch.  That's right.  Transfer to the overview page resulting in the scenario above.

I had never seen this behavior before, but then again, I normally use Redirect instead of Transfer.  I have read a number of articles and none of them mention the possibility of this happening.  All of them say that the page terminates and transfers to the new page.  Evidently this is the case for all situations other than exceptions.

Note:  This was written in ASP.NET 1.1