zoukankan      html  css  js  c++  java
  • Updatepanel 中使用 Timer 控件 失去焦点问题

    在Update Panel 中 如果使用timer 定时刷新数据,会造成textbox 或者其他控件的焦点丢失问题。

    所以 text box 不能和timer 放在同一个Updatepanel 中。

    建议放在2 个不同的UpdatePanel 中,同时设置UpdateMode 为 condition

     <asp:UpdatePanel  ID="UpdatePanelForQuery" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
              <asp:TextBox ID="TextBoxMachineName" runat="server" CssClass="border" Text=""></asp:TextBox>
            </ContentTemplate>
           
            </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
       <asp:Timer ID="ClusterRef" Interval="3000" runat="server">
      </asp:Timer>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ClusterRef" EventName="Tick" />
        </Triggers>
    </asp:UpdatePanel>

    可以吧后台的方法放在PageLoad中执行。

  • 相关阅读:
    MySQL
    权限(二)
    权限(一)
    化栈为队
    栈的最小值
    实现简易版react中createElement和render方法
    12.整数转罗马数字
    call,apply,bind的理解
    8. 字符串转换整数 (atoi)
    172.阶乘后的0
  • 原文地址:https://www.cnblogs.com/ahghy/p/3408570.html
Copyright © 2011-2022 走看看