I can't claim it to be best/perfect idea but you can give it a try-
1. Add a hidden field to keep status of intenet disconnection status. Make sure that upon first call the value is set to "true" which means client is still connected to the internet.
<asp:hiddenfield id="hfInternetDisStatus" runat="Server" value="True" xmlns:asp="#unknown"></asp:hiddenfield>
2. As you need to check this from client side, so Javacript is a good option. We need to run a timer in javascript and inside the timer funtion we need to write the logic for checking if inetrnet is disconnected.
Function For Internet Connectivity Check
<script type="text/javascript">
function CheckInternetConnection() {
var status = navigator.onLine;
var hfInternetDisStatus=document.getElementById(" <%=hfInternetDisStatus.ClientID%>");
if (!status) {
hfInternetDisStatus.value="Flase"
}
}
</script>
Function for timer
<script type="text/javascript">
function StartMyTimer()
{
setInterval(function () {CheckInternetConnection()}, 1000);
}
</script>
3.
Set the timer
<body onload="StartMyTimer();" />
Either you can redirect the user to the login page once internet is available after disconnection which is illustrated in the commented code or if you want to redirect the user if he/she ineracts with the page then the redirect to login page should go in your respective/common method based upon the value contained in the hidden field.
I haven't executed any of the code snippets, this just an idea to start with. You may need to add/modify the code as per your requiremet.
Hope, it helps :)