Create a hidden ASP input field to store the position through the postback, pass the ClientID of this field to the code below:
var hiddenInputId = '<%= _myHiddenInputField.ClientID %>';
function storeScrollPosition(){
$('#'+hiddenInputId)[0].value = scrollPosition();
}
function loadScrollPosition(){
var curPosition = $('#'+hiddenInputId)[0].value;
if (curPosition > 0)
$(window).scroll(curPosition);
}
function scrollPosition() {
var n_result = window.pageYOffset ?
window.pageYOffset : 0;
var n_docel = document.documentElement ?
document.documentElement.scrollTop : 0;
var n_body = document.body ?
document.body.scrollTop : 0;
if (n_docel && (!n_result || (n_result > n_docel)))
n_result = n_docel;
return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
$(document).ready(function(){loadScrollPosition();});
$(window).scroll(function(){storeScrollPosition();});
. , :)