If you are new to programming or just interesting in learning how other developers approach the art of software development, you should check out Jan Schreuder's article on the subject.
He tries to explain the caveats in software development and how to mitigate them properly. It’s very interesting stuff and I agree with most of his arguments, except the one with writing safe code. In my opinion it is a syntax related issue and has nothing to do with safety. But I do understand his point though. Great article.
For some strange reason, Firefox caches ASP.NET pages even if you tell it not to. This could create problems with the back-button. Normally you can tell the browser how to cache your web page in two ways. You can use meta tags or set some HTTP headers. To be absolutely sure that all browsers understand you cache policy, you could combine the two.
However, when you don’t want the browser to cache your page, Firefox caches it anyway. It does so because it cannot se any difference between how the page looked before and after you pressed the back-button. This issue drove me absolutely nuts today, and it took me a while to come up with a solution.
To make the back-button work with the cache in Firefox, add the ETag header to your page. Its value is a random number, and this will tell Firefox that all pages are different, even when you use the back-button to view a previously viewed page. Here’s an example that tells Firefox not to cache your page. Just add these lines to the Page_Load event:
Random rd = new Random();
Response.AddHeader("ETag", rd.Next(1111111, 9999999).ToString());
Response.AddHeader("Pragma", "no-cache");
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();
Response.Expires = -1;
I don’t know why the ETag header is necessary in Firefox. I find it rather disturbing that the big browsers cannot agree on network issues like this.