How to persist scroll position using Master Page?

六眼飞鱼酱① 提交于 2019-12-07 06:49:33

问题


I have a site that uses master pages, the only content that changes is a Div in the centre of the page.

Is there a way that I can persist the scroll position of the page between postbacks? I'm thinking that it might be possible because all pages are using the same Master Page, if not is there some other way to do this?

Thanks


回答1:


Try adding this.Page.MaintainScrollPositionOnPostBack = true; somewhere in the masterpage code behind (for example page load)




回答2:


Try this: http://radio.javaranch.com/pascarello/2005/07/18/1121709316718.html




回答3:


4guysfromrolla.com has an article where a custom server control is created to maintain scroll position across postbacks. Maybe it could be of some use to you.



来源:https://stackoverflow.com/questions/992887/how-to-persist-scroll-position-using-master-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!