While the technique provided here is definitely valid, one huge thing you missed is I would probably bet that a lot of novice web developers will take this code as is and use it in their web applications, without realizing the multi-threaded problems that might arise when using this code.

Since ASP.NET is a multi-threaded environment, multiple threads could be failing and accessing the static variable at the same time, causing the retries variable to change from multiple threads, which would cause its value to be changed by one thread while another thread is dependent on the value being a certain thing.