问题描述:

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..

相关阅读:
Top