scroll go to the top page

后端 未结 4 1292
迷失自我
迷失自我 2020-12-22 06:34

net use web methods to save data from JavaScript when i press save the all page go the top how i can save state position after post back

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-22 07:14

    The reason the page is returning to the top, is because it is being Submitted and hence reloaded.

    If you want to keep the position of the page you have 2 options;

    1) Use a Anchor (See: http://www.hypergurl.com/anchors.html) 2) Post your form using AJAX and then you do not need to reload the page

    Option 2 is the prefered, if you are using webforms you could use an AJAX Update Panel, or if you are using MVC you can do it using JQuery.

提交回复
热议问题