开发者

Using MaintainScrollPositionOnPostBack with CollapsiblePanelExtender

开发者 https://www.devze.com 2023-02-26 18:36 出处:网络
When setting the Page directive for MaintainScrollPositionOnPostBack to true on pages with CollapsiblePanelExtenders, the page does not properly maintain the scrolling position once a postback is made

When setting the Page directive for MaintainScrollPositionOnPostBack to true on pages with CollapsiblePanelExtenders, the page does not properly maintain the scrolling position once a postback is made.

I've noticed that once the postback is made, the browser attempts to scroll to the original position before the collapsible panels are expanded again (as they are loaded in开发者_开发技巧 a collapsed state, and then expanded on the client side), and so the scrolling position either does not move at all or it makes it only part way.

One potential solution I can think of is to wrap the affected panels in an UpdatePanel to avoid the hard postback altogether, but this is not particularly ideal since this issue affects multiple screens.


You could capture the state of the CollapsiblePanelExtender into a HiddenField, then deal with the state of the CollapsiblePanelExtender serverside during the postback.

There are some examples here.

0

精彩评论

暂无评论...
验证码 换一张
取 消