页面定位 scrollIntoView()

scrollIntoView() 滚动包含此元素的文档,直到此元素的上边缘或下边缘与此文档窗口对齐为止

如aspx页面有 Label1,想PostBack后定位于此

string s = "<script>function window.onload(){document.all('" + this.Label1.ClientID + "').scrollIntoView();}</script>";
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "js", s);

原文地址:https://www.cnblogs.com/yangfan/p/1415091.html