问题
how can I prevent page from scroll up after user click link button I have update panale warp my form I try to user on OnClientClick="return false" but no use even I try this Javascript function
window.scrollTo = function (x, y) {
return true;
}
回答1:
You can try .Focus() server-side method. E.g. if your LinkButton is called LinkButton1, add this to your Linkbutton's Click event handler:
LinkButton1.Focus();
回答2:
Try setting the MaintainScrollPositionOnPostBack property to false (MSDN reference). If that doesn't work, take a look at this script for maintaining scroll position for async postbacks.
来源:https://stackoverflow.com/questions/18344625/prevent-page-from-scroll-up-in-asp-net-link-button