CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » CodeDigest » Move/Scroll Page to Top After Asynchronous Postback in UpdatePanel in ASP.Net AJAX   You are not logged in.
Search
 

Sponsors
InstallShield
 

Sponsored Links
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Move/Scroll Page to Top After Asynchronous Postback in UpdatePanel in ASP.Net AJAX
Move/Scroll Page to Top After Asynchronous Postback in UpdatePanel in ASP.Net AJAX
Submitted By Satheesh Babu
On 7/7/2009 7:03:27 AM
Tags: ASP.Net AJAX,CodeDigest  

Move/Scroll Page to Top After Asynchronous Postback in UpdatePanel in ASP.Net AJAX

 

Move/Scroll Page to Top After Asynchronous Postback in UpdatePanel in ASP.Net AJAX

Sometimes, we may require moving or scrolling the page to top after asynchronous postback caused in a lengthier page. We can do this with the help of PageRequestManager's end request event.

The below code can be used to do that.

 

<script type="text/javascript">

    function pageLoad() {

        var manager = Sys.WebForms.PageRequestManager.getInstance();

        manager.add_endRequest(endRequest);

    }

    function endRequest(sender, args) {

        window.scrollTo(0, 0);

    }

 

</script>

 

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!