R – UpdatePanel contol and moving to top of page

asp.netscrollupdatepanel

I have an asp.net page that is using an UpdatePanel control. When you're on the page and you click the continue button, the page does a partial refresh and you're left in the same scroll position you were before the refresh. How do I ensure that on partial refreshes with the UpdatePanel control that you return to the top of the page.

thanks

Best Answer

There is a javascript call to move the scroll to the top of the page:

window.scrollTo(0,0);

You can wire an event handler to the completion of your AJAX call and add that javascript to your event handler.