maintainscrollpositiononpostback not working with firefox

最后都变了- 提交于 2019-11-28 08:04:54

问题


I am using VS 2008. I like the feature maintainscrollpositiononpostback. It works fine with IE 8. But it does not work consistently with Firefox. Sometimes, instead the line I click on goes to the bottom of the page. The field I am trying to refresh is with a div tag with overflow set to auto. Also I have several update panels with updatemode set to conditional. This means only the panel affected should be refreshed. This is also not working in the case on Firefox.

I have searched the web for possible solutions but none of them work for me.

Most of my users use Firefox so this is a problem for me.

Thanks in advance,

Bob


回答1:


scrollsaver to the rescue? http://en.hasheminezhad.com/scrollsaver

I found this little js file a few weeks ago after implementing Post/Redirect/Get on a few of my pages. It may enable you to turn off maintain on your pages if you throw it in the master. I haven't fully tested it with ff4/5 or chrome...




回答2:


Edit the Browser Capabilities file, and explicitly set it so that MaintainScrollPositionOnPostback is supported on Safari Browsers.




回答3:


you can use javascript for this.. chek it out..

http://weblogs.asp.net/andrewfrederick/archive/2008/03/04/maintain-scroll-position-after-asynchronous-postback.aspx



来源:https://stackoverflow.com/questions/2866770/maintainscrollpositiononpostback-not-working-with-firefox

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