Maintaining Scroll Position and Selected Control on Postback

前端 未结 1 1121
夕颜
夕颜 2021-01-20 01:24

Back with another web based issue.

When a control issues a postback to the server the page refreshes (Fine). The page also scrolls back to the top and loses the cont

1条回答
  •  再見小時候
    2021-01-20 02:06

    First of all, the MaintainScrollPositionOnPostback="true" has a known bug in asp.net 2.0, see here.

    Also, the correct syntax is maintainScrollPositionOnPostback. (lowercase m)

    I used the maintainScrollPositionOnPostback but have many problems in IE, then I use the asp.net AJAX Control Toolkit UpdatePanel, it solves the problem (the page don't scroll to the top) and save some bandwidth.

    EDIT:

    I think I understand your problem, it's mantain the focus on the element, it can be done using some javascripts workarounds, se here.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题