ASP.NET:滚动到控件

标签 asp.net controls scroll focus

我在页面中有一个特别大的表格。当表单通过验证且字段无效时,我想将窗口滚动到该控件。调用控件的Focus()似乎没有做到这一点。我找到了一种JavaScript解决方法,可以将窗口滚动到控件,但是ASP.NET内置了什么?

最佳答案

Page.MaintainScrollPositionOnPostBack = False
Page.SetFocus(txtManagerName)

关于ASP.NET:滚动到控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/746070/

相关文章:

delphi - 控件 ''没有父窗口: Why is control not named?

javascript - 没有jquery的无限滚动?

android - 出现键盘时向上滚动屏幕

mysql - System.Threading.ThreadAbortException

.net - .NET 的 Markdown ? SO 如何即时渲染它?

asp.net - ASP.NET MVC 中的 ViewBag 如何工作

html - 覆盖 IE 本地 Intranet 设置

c# - 以编程方式将超链接添加到不是 DisplayMode=Hyperlink 的项目符号列表

android - 让ObtainStyledAttributes在xamarin for Android中正常工作

android - 自动垂直滚动文本