How to maintain scroll position on autopostback?

前端 未结 12 1762
臣服心动
臣服心动 2020-12-30 21:49

How can I get back to the same position of a page on postback. It always seems to get to the top of the page.

I\'ve tried using maintainSc

12条回答
  •  忘掉有多难
    2020-12-30 22:31

    Try this. It's working for me.

     
    
     
     

    if (Page.IsPostBack) {
    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "afterpostback();", true);
    }
    

提交回复
热议问题