ASP.NET Secrets, Part 5
Welcome to the fifth and final part of ASP.NET Secrets!
I'm Karl Moore and over the following half-a-dozen pages, we'll be wrapping up our look at building interactive sites with the following bundle of tricks, based on tips listed in my new book, VB.NET and ASP.NET Secrets:
- Using .IsClientConnected for Long Processes
- What to Do When Session_End Doesn't Work
- Spy on your Web Host: Checking Uptime in .NET
- Can It Cope?—Stress Testing your Web Apps
Of course, this may be the last part of the ASP.NET Secrets articles; however, it's only the eighth article in the entire .NET Secrets series of articles we're running. We still have .NET Data Secrets and Web Service Secrets to follow, starting in a couple weeks' time.
But that's all to come. For now... the ASP.NET secrets!
Using .IsClientConnected for Long Processes
If you're performing a long process or calculation behind a Web page, it's a good idea to periodically check whether your client is still connected. You may want to do this at set intervals in your code, or just before sending your results down to the browser.
You can do this through the innovatively titled function, Response.IsClientConnected. It'll return a True if the client is still connected to the server. If it isn't, you'll want to exit your code and run a Response.End.