Monday, June 9, 2008

Adding an UpdateProgress Control to show progress @ server

http://asp.net/AJAX/Documentation/Live/tutorials/CreateSimpleAJAXApplication.aspx

 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>

            <asp:Label ID="lblServerTime" runat="server" Text="Server Time"></asp:Label>

            <asp:Timer ID="Timer1" runat="server" Interval="10000">

            </asp:Timer>

        </ContentTemplate>

    </asp:UpdatePanel>

    <asp:UpdateProgress ID="UpdateProgress1" runat="server">

        <ProgressTemplate>

            Getting time from server ...

        </ProgressTemplate>

    </asp:UpdateProgress>

</asp:Content>

 

Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    System.Threading.Thread.Sleep(3000)

    lblServerTime.Text = DateTime.Now.ToString()

End Sub

No comments: