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
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.
Page 1 of 4