Timer for Timeout

Posted by: grapecity on 15 March 2018, 2:26 am EST

    • Post Options:
    • Link

    Posted 15 March 2018, 2:26 am EST

    I need to

    Response.Redirect(“WebForm1.aspx”)

    after 2 minutes inactivity

  • Posted 15 March 2018, 9:05 pm EST

    Hello,

    This does not look like an issue related to Spread for ASP.NET, however you can can try the following approach to redirect the user to a certain page on inactivity for some time:

    
    ou need javascript:
    
    <script type="text/javascript">
    setTimeout(onUserInactivity, 1000 * 120)
    function onUserInactivity() {
       window.location.href = "WebForm1.aspx"
    }
    </script>
    
    

    This will redirect the user after 2 Minutes of inactivity. If you want to make it dependend of the mouse-moving, try:

    
    
    <script type="text/javascript">
    inactivityTimeout = False
    resetTimeout()
    function onUserInactivity() {
       window.location.href = "onUserInactivity.php"
    }
    function resetTimeout() {
       clearTimeout(inactivityTimeout)
       inactivityTimeout = setTimeout(onUserInactivity, 1000 * 120)
    }
    window.onmousemove = resetTimeout
    </script>
    
    
    

    I hope it helps.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels