开发者

Specify when UpdateProgress Control are displayed

开发者 https://www.devze.com 2023-04-05 07:43 出处:网络
Does anyone have a resource or provide a code开发者_JAVA技巧 sample on when not to display an UpdatePrgress Control when a certain button is clicked.in your Markup:

Does anyone have a resource or provide a code开发者_JAVA技巧 sample on when not to display an UpdatePrgress Control when a certain button is clicked.


in your Markup:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <fieldset>
        <legend>UpdatePanel</legend>
        <asp:Label ID="Label1" runat="server" Text="Initial page rendered."></asp:Label><br />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
        </fieldset>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
    <ProgressTemplate>
        Processing...
    </ProgressTemplate>
</asp:UpdateProgress>

in your code behind:

protected void Button1_Click(object sender, EventArgs e)
{
    // Introducing delay for demonstration.
    System.Threading.Thread.Sleep(3000);
    Label1.Text = "Page refreshed at " +
        DateTime.Now.ToString();       
}

this should work, try it...

source: Introduction to the UpdateProgress Control

0

精彩评论

暂无评论...
验证码 换一张
取 消