Reputation: 1230
Can anybody tell me how can i save the location of the browser scrollbar. I have a form kind of page containing some postbacks, after postback i want the page location to be same where the user was. I mean the part of the page (middle or down or up). Currently, after postback the scroll is up, ie its displaying the upper part of the page.
Thanks in advance
Upvotes: 0
Views: 1580
Reputation: 655
In your asp.net page markup (top line of your aspx page) set MaintainScrollPositionOnPostBack = true; however it sometimes does not work properly with some third party controls, so if you're just using standard asp.net controls you're good.
Upvotes: 0
Reputation: 21366
you can set in your code behind
System.Web.UI.Page.MaintainScrollPositionOnPostBack = true;
this will keep the scroll position in the page only
if you wan to do it for all pages use Web.config page section
<pages maintainScrollPositionOnPostBack="true" />
Upvotes: 1
Reputation: 8259
You can:
Upvotes: 0