SetScroll();
function SetScroll() {
if (window.attachEvent) {
window.attachEvent("onscroll", SaveScrollValue);
}
else {
window.addEventListener("scroll", SaveScrollValue, false);
}
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(SetScrollValue);
function SaveScrollValue(sender, args) {
var scrollTemp = document.getElementById("<%=HiddenFieldScroll.ClientID%>");
if (scrollTemp != null)
scrollTemp.value = document.body.scrollTop + document.documentElement.scrollTop;
}
function SetScrollValue(sender, args) {
var scrollTemp = document.getElementById("<%=HiddenFieldScroll.ClientID%>");
if (scrollTemp != null) {
//window.scroll(0, scrollTemp.value);
document.documentElement.scrollTop = scrollTemp.value;
if (document.documentElement.scrollTop == 0) {
document.body.scrollTop = scrollTemp.value;
}
}
}