Nemlátí. Nejde to ani na prázdné stránce. Příklad - ASPX:
<h2>Progress se nezobrazí</h2>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Async" onclick="Button1_Click" />
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
Načítam...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate>
DisplayName: <asp:TextBox ID="DisplayNameTextBox" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<h2>Progress zobrazí</h2>
<asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
<ProgressTemplate>
Načítam...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Button ID="Button2" runat="server" Text="Async" onclick="Button2_Click" /><br />
DisplayName: <asp:TextBox ID="DisplayNameTextBox2" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
CS:
protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
DisplayNameTextBox.Text = DateTime.Now.ToString();
}
protected void Button2_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
DisplayNameTextBox2.Text = DateTime.Now.ToString();
}
|