开发者

Specify when UpdateProgress Control are displayed

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜