Tuve el mismo problema. No hay una manera fácil de decirle a la actualización Progreso que se realice en línea. Sería mejor que transfiera su propio elemento updateProgress. Puede agregar un oyente beginRequest y un oyente endRequest para mostrar y ocultar el elemento que desea visualizar en línea. Aquí es simple página que muestra cómo hacerlo:
aspx
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server" ID="up1" UpdateMode="Always">
<ContentTemplate>
<asp:Label ID="lblTest" runat="server"></asp:Label>
<asp:Button ID="btnTest" runat="server" Text="Test" OnClick="btnTest_OnClick" />
</ContentTemplate>
</asp:UpdatePanel>
<img id="loadingImg" src="../../../images/loading.gif" style="display:none;"/><span>Some Inline text</span>
<script>
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function(sender, args) {
if (args.get_postBackElement().id == "btnTest") {
document.getElementById("loadingImg").style.display = "inline";
}
});
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) {
if (document.getElementById("loadingImg").style.display != "none") {
document.getElementById("loadingImg").style.display = "none";
}
});
</script>
</div>
</form>
cs
public partial class updateProgressTest : System.Web.UI.Page
{
protected void btnTest_OnClick(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(1000);
this.lblTest.Text = "I was changed on the server! Yay!";
}
}
genial, tomando cosas de mono en una excelente idea! –
Estoy cambiando la respuesta aceptada (lo siento Steven!) Porque este enfoque funcionó mejor. Publiqué la fuente en mi Control UpdateProgressEx: http://www.stum.de/2010/01/28/an-asp-net-ajax-updateprogress-that-can-render-inline/ –