Tuesday, December 2, 2008

Stop the Scrolling of your page on the Page Refresh.

HELLO All

if you want to stop the scrolling of your page which carry the huge amount of data in asp.net then u can use following code after the Script manager.

There is one more option to stop a scrolling in web.config.
Maintainscrollpostion tag in web.config.
But its not work in my case A huge amount of images on my home page and these image refresh after some time and when it refresh page , page scroll on the any uncertain positions.

then i put that JavaScript code in master page after the script manger.

var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(beginRequest);
function beginRequest()
{

prm._scrollPosition = null;

}

hope it also help in your case.