Web.config Level => pages maintainScrollPositionOnPostBack="true" />
Page Level => <%@ Page MaintainScrollPositionOnPostback="true" %>
Code Level => Page.MaintainScrollPositionOnPostBack = true;
Browser Level => browser id="Chrome" parentID="Safari1Plus"> capabilities> capability name="supportsMaintainScrollPositionOnPostback" value="true" /> capabilities> browser>
Any of the 4 ways mentioned above did not work with google chrome. It is working fine with firefox. Kindly provide any solution .
You can add this snippet to your ASP.NET Page/MasterPage (jQuery required):
<asp:HiddenField runat="server" ID="hfPosition" Value="" />
<script type="text/javascript">
$(function () {
var f = $("#<%=hfPosition.ClientID%>");
window.onload = function () {
var position = parseInt(f.val());
if (!isNaN(position)) {
$(window).scrollTop(position);
}
};
window.onscroll = function () {
var position = $(window).scrollTop();
f.val(position);
};
});
</script>