2014年7月13日 星期日

[RESOLVED] Run method after page has loaded


Hi. I have a method PingServer() which pings a server and then updates a label with Offline or Online. The method runs on page load. However, if the server is offline, the ping takes some time to complete, and the page will simply be blank until it finishes.


So I'm wondering how I can load the page and have the label say something like "Checking server status.." until the ping is complete?


Thanks!



Did you try doing a response.flush before your ping?



This could be something best done client-side using a web service. This way you can perform an ajax call that, when complete sets the label or indicates a failure message. That way the page can load up and go and not be hung up waiting for an external server
ping.


沒有留言:

張貼留言