Often times when dealing in ASP.NET (or even classic ASP), you need to know when events fire in IIS to know how to handle them. I have often Googled this when working on a project and there are rafts of documentation out there, but here's a quick primer:
http://www.codeproject.com/KB/aspnet/PageLifeCycle.aspx