First of all, this question belong in the ASP.NET forum, but since it's a simple question I'll answer it here anyway. The red X in IE (or any browser) does nothing on the server. HTTP is a client-request/server-response mechanism and only client-side scripting events would know that your browser is closing. Also, if you read the documentation for ASP.NET (always a good thing), the Application_End handler executes when your ASP.NET web application is shutting down (as leppie tried to point out with little extra helpful information). Each client does not get a separate instance of a web application - that would be stupid (wouldn't scale well, among many other things). Each additional client gets a separate context (a thread), optionally with a session attached. If you want to store information per-client and clean it up, use the Session property found on many objects (like HttpContext, Page, et. al.) and handle clean-up in the Session_End handler in Global.asax. This still won't fire when a user closes the browser, however. It will fire when the session is destroyed. The default is in 30 minutes. Please direct future questions to the appropriate forums. This is an ASP.NET related question - it doesn't matter if you wrote it in C# or not; C# is just one many languages that target and use the .NET Framework.
Microsoft MVP, Visual C# My Articles