停止页面滚动页面回发 [英] Stop page scrolling on page post back

查看:69
本文介绍了停止页面滚动页面回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的div标签里面有一个复选框。

当我点击我的复选框时,页面会滚动到div标签的顶部。



我试过了,

I have a check box inside my div tag.
When I click my check box, page scrolls to top of the div tag.

I have tried,

MaintainScrollPositionOnPostback="true"



我也试过


And I have also tried

window.scrollTo(0,document.body.scrollHeight);



这两项功能都不起作用。

请帮我。在此先感谢


Both these functionality is not working.
Please help me. Thanks in advance

推荐答案

最简单的解决方案是你的问题是让你的复选框作为客户端控制。从服务器属性移动runt它。如果你有进一步的查询请告诉我。 :)



喜欢这个:

The simplest solution is for your problem is make your check box is as client side control.Remove runt at server attribute from it.If you have further queries please let me know. :)

Like this :
<input type="checkbox" name="vehicle" value="Car">I have a car 


参考



http://stackoverflow.com/questions/10134963/prevent-page-scrolling-after-postback [ ^ ]



+滚动+的+网页+ http://forums.asp.net/t/1807203.aspx?How+do+I +停止+ +页+从+滚动+开+回发+ [ ^ ]
Refer

http://stackoverflow.com/questions/10134963/prevent-page-scrolling-after-postback[^]

http://forums.asp.net/t/1807203.aspx?How+do+I+stop+the+page+from+scrolling+on+postback+[^]


这篇关于停止页面滚动页面回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆