Reputation: 16629
I have defined an <asp:UpdatePanel>
with an <asp:UpdateProgress>
as
<asp:ScriptManager ID="sm1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="update1" runat="server">
<ContentTemplate>
<asp:Label id="lblresult" runat="server"></asp:Label><br /><br />
<asp:Button ID="btn1" runat="server" Text="Refresh" OnClick="btn1_Click" /> <br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="update1">
<ProgressTemplate>
<span style="color:green; font-style:italic;">Loading, please wait...</span>
</ProgressTemplate>
</asp:UpdateProgress>
The button event is defined as
protected void btn1_Click(object sender, EventArgs e)
{
lblresult.Text = "<span style='color:red;'>"+ DateTime.Now.ToString() +"</span>";
}
However, I do not get the Loading, please wait...
Upvotes: 0
Views: 4195
Reputation: 11
<script type="text/javascript">
var updateProgress = null;
function postbackButtonClick() {
updateProgress = $find("<%= uprMaster.ClientID %>");
window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
return true;
}
</script>
<asp:Button runat="server" Text="Search" ID="btnSearch" OnClick="btnSearch_Click" ClientIDMode="Static" OnClientClick="return postbackButtonClick();" />
Upvotes: 1
Reputation: 6967
put the update progress inside like this
<asp:ScriptManager ID="sm1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="update1" runat="server">
<ContentTemplate>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="update1">
<ProgressTemplate>
<span style="color:green; font-style:italic;">Loading, please wait...</span>
</ProgressTemplate>
<asp:Label id="lblresult" runat="server"></asp:Label><br /><br />
<asp:Button ID="btn1" runat="server" Text="Refresh" OnClick="btn1_Click" /> <br />
</ContentTemplate>
</asp:UpdatePanel>
</asp:UpdateProgress>
Upvotes: 0