将焦点设置在回发 [英] Set focus on postback
问题描述
我有一个预订表在我的网站上的网页表单。
I have a Booking Form in a webform on my website.
3个选项都自动回启用。问题是,当一个被触发,从顶部页面重新加载
3 options have autopostback enabled. Problem is when one is triggered, the page reloads from the top.
如何从做回发的选项重装?
How to reload from the option that did the postback?
我敢肯定,有一个简单的解决这个?
I'm sure there's an easy solution to this?
问候
茶
推荐答案
设置<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.page.maintainscrollpositiononpostback.aspx\"相对=nofollow> MaintainScrollPositionOnPostback
以真正
。
-
您可以将它设置编程
You can set it programmatically
Page.MaintainScrollPositionOnPostBack = true;
在页面声明
In the page declaration
<%@ Page MaintainScrollPositionOnPostback="true" %>
或在web.configs &LT;&的System.Web GT;
部分。
<pages maintainScrollPositionOnPostBack="true" />
另一种选择是使用异步回发,例如与ASP.NET AJAX控件工具包。然后,只有特定的区域重新装入的JavaScript,而不是整个页面。
Another option is to use asynchronous postbacks for example with the ASP.NET Ajax Control Toolkit. Then only certain areas are reloaded with javascript and not the whole page.
这篇关于将焦点设置在回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!