This is a migrated thread and some comments may be shown as answers.

Keep alive with jquery

1 Answer 267 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 04 May 2012, 04:09 AM
Can somebody help me to integrate this source code into a Telerik asp.net ajax?

http://zeeshanumardotnet.blogspot.mx/2010/11/how-to-keep-session-alive-in-aspnet.html

I need to have an intranet with no session timeout lost.

1 Answer, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 05 May 2012, 12:34 AM
<script type="text/javascript">
    $telerik.$(document).ready(function () {
        alert("Document is ready");
        setTimeout(updateSession, 1000 * 60); //Timeout is 1 min
    });
 
    function updateSession() {
        $telerik.$.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../../asmx/eKeepAlive01.asmx/UpdateSession",
            data: "{}",
            dataType: "json"
        });
        setTimeout(updateSession, 1000 * 60);
    }
</script>


Adding $telerik. was the trick for having the code running with jquery.
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or