On my page there are few updatepanels and each of them has its own ajax always visible control, which shows animation. Always visible control displays animation at the right bottom corner of the page.
If the bottom updatepanel does any asynchronous postback then page scrolls up automatically and shows relavent visible control and then scrolls down automatically once its finished with asynchronous postback.
Anyone knows that why does the page scrolls up automatically?
Usually People loves to maintain the scroll postiion. But requirment is reverse, Here is the trick, create an script tag after the scriptmanager and put the following lines:
<script type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(beginRequest); function beginRequest() { prm._scrollPosition = null; } </script>
momer40
Member
34 Points
66 Posts
Page automatically scrolls up and down on asynchronous postback - UpdatePanel with ajax always v...
Sep 13, 2011 08:00 PM|LINK
Hi,
On my page there are few updatepanels and each of them has its own ajax always visible control, which shows animation. Always visible control displays animation at the right bottom corner of the page.
If the bottom updatepanel does any asynchronous postback then page scrolls up automatically and shows relavent visible control and then scrolls down automatically once its finished with asynchronous postback.
Anyone knows that why does the page scrolls up automatically?
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Page automatically scrolls up and down on asynchronous postback - UpdatePanel with ajax alwa...
Sep 14, 2011 03:04 AM|LINK
Usually People loves to maintain the scroll postiion. But requirment is reverse, Here is the trick, create an script tag after the scriptmanager and put the following lines:
<script type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(beginRequest); function beginRequest() { prm._scrollPosition = null; } </script>http://aspnet.4guysfromrolla.com/articles/111704-1.aspx
http://basgun.wordpress.com/2008/06/09/maintain-scroll-position-updatepanel-postback/
<pages smartNavigation="true" MaintainScrollPositionOnPostback="true"/>
Lety me know if this helpful to you
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
momer40
Member
34 Points
66 Posts
Re: Page automatically scrolls up and down on asynchronous postback - UpdatePanel with ajax alwa...
Sep 14, 2011 11:43 AM|LINK
Hi Chetan,
Thanks for your input but i actually want to keep the scroll bar position.
I am going to run some tests on my code and will see if i can find the problem, otherwise i will paste my aspx code here.
Many Thanks