Today I was sending some messages to my friends on Facebook. My friend by accident plug-out my network cable and I didn't see my connection lost. When I tried to send my message, Facebook gave me a little error on message sendin window, but Facebook was looking very good as when my connection online. When connection losts during form or data sending/receiving process on my Asp.NET web sites. Standart开发者_C百科 "Page can not be displayed. Try again." page shows up. How can we do it like facebook?
The way Facebook shows "lost connection" message is executing client side script. Facebook makes an ajax request and by using jquery you can handle error event if request fails, which will fail if your internet connection goes down, and display "lost connection" message.
精彩评论