A lot of people over the net asks the same question :
How to find out if the Internet connection is connected or disconnected in ASP.NET?
But ASP.NET runs on the server, so if the user's Internet connection is disconnected,then the browser will not be able to connect to the web server to run ASP.NET code, that's why I thought this code should be client-side, so I digGed a little in java-script and here is an example of what I found out:
<script language="javascript">function CheckOnline()
{
if(navigator.onLine)
alert("You're online");
else
alert("You're offline");
}
</script>
<
body onload ="CheckOnline()">
</body>
I test it on Internet Explorer 7 and Mozilla and it worked well.
Hi,
A new update for the ASP.NET Dynamic Data Preview just released, it provide more new features and additional support to the existed data controls such as GridView, ListView, FormView, DetailsView...
To download it and give it a try here.
Resources:
Dynamic Data Samples.
ScottGu's Blog