如何保持滚动条位置 [英] How to Maintain Scroll Bar Position
本文介绍了如何保持滚动条位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
页面回发后如何保持网站页面的滚动条位置
我做了很多尝试,但找不到答案.
请帮助我.
How Can i maintain my Scroll bar position of my website page when page is postback
i try my self a lot but unable to find answer.
please help me.
推荐答案
嘿,您尝试过很好,但是您的问题有一个非常简单的解决方案.
使用Page Directive
中的简单属性,可以在页面回发时保持滚动条的位置.
hey it is good you tried but your question has a very easy solution.
You can maintain the position of Scroll Bar when page is posted back by using a simple attribute in Page Directive
<%@ MaintainScrollPositionOnPostback="true"%>
默认情况下,其值为False.
by default its value is False.
有关完整的回发,您可以查看以下内容: ^ ]
对于部分渲染,请看以下内容:
通过Javascript处理UpdatePanel中的滚动 [
For a complete postback, you can have a look at this: Maintain Scroll Position on Postback in ASP.NET 2.0[^]
For partial rendering, have a look at this:
Handling scroll in UpdatePanel via Javascript[^]
这篇关于如何保持滚动条位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文