0

In my application I can already redirect the user to the login page after 5 minutes of inactivity. But this only happened after a postback. I wanted the user to redirect to the page after 5 minutes of inactivity without doing a postback. As long as he didn't click anything (e.g. sorting) after 5 minutes he will be redirected.

By the way, I'm using update panel on my pages.

Thank you. Please help.

2 Answers2

0

you can use javascript

something like this javascript timer or other one.

0

You can use javascript do detect inactivity. If you're using JQuery, there's a plugin called JQuery.idle

Probably you'll need something like this.

    $(document).idle({
  onIdle: function(){
    // TODO: redirect to logout page.
  },
  onActive: function(){
    // TODO: maybe you don't need it.
  },
  idle: 300000 // 5 minutes then onIndle function will be called.
})

You also will need to register this script with your update panel using ScriptManager.RegisterClientScriptBlock or ScriptManager.RegisterStartupScript. Somehting like this.

Community
  • 1
  • 1
japoneizo
  • 508
  • 1
  • 5
  • 15
  • thanks for the answer, I already got a solution after browsing in the net. I use javascript function wherein the page will refresh after 5 minutes of inactivity. I think its also the same on your answer. – Crissy Nakahara Jun 02 '15 at 05:17
  • You're welcome. Just accept one of the solutions, so people don't think your answer is still open. – japoneizo Jun 02 '15 at 13:40