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

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

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

posted on 2009-03-18 09:39  湛然常寂  阅读(1635)  评论(0编辑  收藏  举报