asp.net - Redirect to login page after session timeout without postback -
in application can redirect user login page after 5 minutes of inactivity. happened after postback. wanted user redirect page after 5 minutes of inactivity without doing postback. long didn't click (e.g. sorting) after 5 minutes redirected.
by way, i'm using update panel on pages.
thank you. please help.
you can use javascript detect inactivity. if you're using jquery, there's plugin called jquery.idle
probably you'll need this.
$(document).idle({ onidle: function(){ // todo: redirect logout page. }, onactive: function(){ // todo: maybe don't need it. }, idle: 300000 // 5 minutes onindle function called. })
you need register script update panel using scriptmanager.registerclientscriptblock or scriptmanager.registerstartupscript. somehting this.
Comments
Post a Comment