Reset session timeout without doing postback in ASP.Net

前端 未结 3 1329
Happy的楠姐
Happy的楠姐 2020-12-06 23:47

Is there any way to reset the session timeout without doing postback?

In this scenario I don\'t just want to hide the postback from user, I need to reset the timeou

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 00:40

    Only way I can think of is to do an ajax call to a dummy .net page like this:

    function keepAlive()
    {
    var xmlHttp = null;
    
    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", "KeepAlive.aspx", false );
    xmlHttp.send( null );
    }
    

    and then call it like this

    
    

提交回复
热议问题