Click here to Skip to main content
11,494,851 members (63,948 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET MVC3

When my mvc3 ASP.NET app timeout I want it to redirect to login page that tells the user that they are timed out.
Posted 12-Nov-12 0:08am
ryanb31 at 12-Nov-12 8:43am
You'll need to track it using JS. Web applications are disconnected so you need a timer that is keeping track of it in JavaScript.
apr1234 at 14-Nov-12 5:08am
Can you please provide the required javascript for the time out.
Actually in MVC we dont have any timers...
ryanb31 at 14-Nov-12 7:40am
There are lots of examples on the web. It's a little too involved to do here. Essentially you write out the session timeout value into a hidden field and then using setTimeout you fire a JS function every minute that increments a counter. But, you also have to have code that resets the counter.
Aman.A at 12-Nov-12 8:44am
have a go at this: Timeout Redirect

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

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 Sergey Alexandrovich Kryukov 354
2 CHill60 293
3 Sascha Lefèvre 255
4 Nakul Chaudhari 236
0 Sergey Alexandrovich Kryukov 10,297
1 OriginalGriff 8,821
2 Sascha Lefèvre 3,864
3 Maciej Los 3,412
4 Richard Deeming 2,500

Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100