当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - How to maintain scroll position of the aspx page which contains usercntrols

问题描述:

i have to maintain scroll position of a page which contains Usercontrols and some buttons in it.

when controls in usercontrols are clicked the page is post-backed.

i want to maintain the page scroll position where it is before.

I have tried Maintainscrollposition= true like this things in my pages.

please suggest me with some examples.

thanks in advance.

网友答案:

make sure you have Maintainscrollposition= true in the page where you use the usercontrol. (i suppose you already tried to put it in the usercontrol header)

if that doesnt work then in page_load, add Page.MaintainScrollPositionOnPostBack = true;

if it still doesnt work then let me know and i will try and find a javascript code i used in the past..

分享给朋友:
您可能感兴趣的文章:
随机阅读: