AjaxToolkit: the last TabContainer on the page is focused on page load

前端 未结 5 2071
梦毁少年i
梦毁少年i 2021-01-18 07:00

I\'m using more than one TabContainer on a page in an ASP.NET project and I noticed a really strange behavior: when the page is loaded the focus jumps to the last TabContain

5条回答
  •  春和景丽
    2021-01-18 07:26

    You can set focus server-side to avoid the page jumping around.

    Try this in Page_Load:

    PageUtility.SetFocus(foo);
    

    Also check you whether you are setting Page.MaintainScrollPositionOnPostback.

    Let me know if that helps.

    UPDATE - you can simply call .Focus() on whatever control you want to be in focus by default.

    eg: YourControlToFocus.Focus()

提交回复
热议问题