• UpdateProgress属性DynamicLayout和DisplayAfter


    aspx
        <form id="form1" runat="server">
            
    <asp:ScriptManager ID="ScriptManager1" runat="server">
            
    </asp:ScriptManager>

            
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1">
                
    <ProgressTemplate>
                    DynamicLayout 
    = false
                
    </ProgressTemplate>
            
    </asp:UpdateProgress>


            
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                
    <ContentTemplate>
                    
    <%= DateTime.Now %>
                    
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
                
    </ContentTemplate>
            
    </asp:UpdatePanel>
            
            
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                
    <ContentTemplate>
                    
    <%= DateTime.Now %>
                    
    <asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button1_Click" />
                
    </ContentTemplate>
            
    </asp:UpdatePanel>
            
            
    <asp:UpdateProgress ID="UpdateProgress2" runat="server" DynamicLayout="true" DisplayAfter="3000">
                
    <ProgressTemplate>
                    DynamicLayout 
    = true
                
    </ProgressTemplate>
            
    </asp:UpdateProgress>
            
            
            
    <hr />
        
    </form>

    cs
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        
    protected void Button1_Click(object sender, EventArgs e)
        {
            Thread.Sleep(
    5000);
        }

    Thread.Sleep(5000);等待5秒
    DynamicLayout,指的是UpdateProgress隐藏的时候是否占位
    DisplayAfter,指的是UpdateProgress延迟多久才显示(单位:毫秒,1秒=1000毫秒)
  • 相关阅读:
    Java WEB 之页面间传递特殊字符
    c++ using Handle Class Pattern to accomplish implementation hiding
    c++ simple class template example: Stack
    c++ why can't class template hide its implementation in cpp file?
    c++ what happens when a constructor throws an exception and leaves the object in an inconsistent state?
    c++ 用namespace实现java的package的功能
    c++ virtual 和 pure virtual的区别
    c++ istream(ostream)是如何转换为bool的
    c++ 使用boost regex库 总结
    c++ 如何使用第三方的library
  • 原文地址:https://www.cnblogs.com/timy/p/1167863.html
Copyright © 2020-2023  润新知