What is the best way to reset the scroll position to the top of page after the an asynchronous postback?
The asynchronous postback is initiated from a ASP.NET Grid
Here is the perfect solution to reset scroll bar position to TOP in AJAX
Client Side Code
function ResetScrollPosition()
{
setTimeout("window.scrollTo(0,0)", 0);
}
Server Side Code
ScriptManager.RegisterStartupScript(Page, this.GetType(), "ScrollPage", "ResetScrollPosition();", true);
Only,window.scrollTo(0,0) will not work. Ajax will take precedence in this case so you have to use setTimeout function with that.