Last Updated: February 25, 2016
·
385
· gifthlong

Maintain scroll

 ```javascript   
    <script type="text/javascript"> 
    var scrollTop; 
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler); 
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); 

    function BeginRequestHandler(sender, args) 
    { 
    var elem = document.getElementById('leftBar'); 
    scrollTop=elem.scrollTop; 
    var status = document.getElementById('serverStatus'); 
    status.style.visibility='visible'; 
    } 

    function EndRequestHandler(sender, args) 
    { 
    var elem = document.getElementById('leftBar'); 
    elem.scrollTop = scrollTop; 
    var status = document.getElementById('serverStatus'); 
    status.style.visibility='hidden'; 
    } 
    </script>
```

ASP.NET AJAX: Creating Reusable JavaScript Components (that are not Controls)

http://mattberseth.com/blog/2008/06/aspnet_ajax_creating_reusable.html