将焦点设置在回发 [英] Set focus on postback

查看:90
本文介绍了将焦点设置在回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个预订表在我的网站上的网页表单。

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 真正


  1. 您可以将它设置编程

  1. 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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆