Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all,

Mine is an MVC application. If internet connection goes down I need to redirect to logout page.Can any one help how to implement.

After reestablishing the connection also redirection should happen to login page. once connection lost.

thanks
Hyma
Posted
Comments
F-ES Sitecore 11-Aug-15 7:20am    
How is it going to request the logout page if the connection is lost?
HymaKG 11-Aug-15 7:26am    
how to check I am online or offline in firefox and chrome. As per can I set flag
virusstorm 11-Aug-15 11:39am    
Make sure you hit "Reply" to the user's comment otherwise they won't see your post.

If the internet connection goes down, the browser will tell the user the page is unavailable if they try to navigate away from it. If you have any Ajax type calls being made, the call will simply timeout and exception will get raised in your JavaScript.

What is your goal by setting a flag or wanting to redirect them to the logout page?
HymaKG 11-Aug-15 12:20pm    
When internet connection goes down i want to loout. browser mozilla and chrome are my browsers.
virusstorm 11-Aug-15 12:32pm    
That is a Mozilla only feature
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine

But I still don't understand why you need this? I only ask because I might be able offer a better approach if know what the need is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900