ASP.NET 2.0中的ScrollPosition [英] ScrollPosition in ASP.NET 2.0
本文介绍了ASP.NET 2.0中的ScrollPosition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我知道这对你来说可能是个问题,但我觉得很困难。
我使用的是ASP.NET 2.0版本。
在我的网页上,有很长的帖子和评论列表。
问题是,如果我向下滚动到最后一个帖子并单击像按钮(为每个帖子提供按钮)。
它会回到页面顶部。
我希望保持滚动位置。
i尝试使用 - Page.MaintainScrollPositionOnPostBack = true;
但它不起作用。
请帮帮我。
Dear All,
I know this may beeasy question for you but m finding it difficult.
I am using ASP.NET 2.0 version.
In my web page, there is long list of post and comments.
question is , if i scroll down to last post and click like button(Like button is provided for every post).
it goes to top of page.
I want scroll position to be maintained.
i tried using - Page.MaintainScrollPositionOnPostBack = true;
but it is not working.
Please help me out.
推荐答案
如果我向下滚动到最后一个帖子并点击像按钮(每个帖子都提供了按钮)。它会进入页面顶部。
为什么会这样实现?对于''喜欢''异步传递请求。现在,当您单击链接时,发生了回发,因此页面顶部。
如果你想坚持当前的实施(这是实际问题),试试:
在ASP.NET 2.0中回发时保持滚动位置 [ ^ ]
我使用span标签代替锚标签比如link。
现在正在工作。
I used span tag instead of anchor tag for "Like" link.
And its working now.
这篇关于ASP.NET 2.0中的ScrollPosition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文