Thursday, June 19, 2014

Maintain Scroll Position after Asynch Postback

  
    var goTop = parseInt($.cookie("posName"));
    if (goTop) {
        $(document).scrollTop(goTop);
        $.cookie("posName""");
    }
 
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    try {
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
    }
    catch (err) { }
    
 
    
    function InitializeRequest(sender, args) {
        try {
            //debugger;
            var elem = document.getElementById('Container');
            var scrollTop = $(document).scrollTop();
            debugger;
            $.cookie("posName", scrollTop);
            
            showHideLoading(truetrue);
 
        } catch (err) { }
 
    }

No comments:

Post a Comment