Imagine this scenario: within an HTML page, using an UpdatePanel, you have a loading animated gif spinning while ASP.NET processes data from a webservice.
I'm curious if there's a way to create an Event in .NET code that can be detected on the HTML side, like:
Let's say I'm fetching individual persons' data from a webservice and I want the loading message on the HTML page to update accordingly.
Importing person 1
Importing Person 2
Importing Person 3
All Done!
and done
Is there a clever trick to achieve this?
Currently, my HTML Code has the following:
the HEAD section
<script type="text/JavaScript" language="JavaScript">
function pageLoad() {
try {
var manager = Sys.WebForms.PageRequestManager.getInstance();
manager.add_endRequest(endRequest);
manager.add_beginRequest(OnBeginRequest);
manager
}
catch (err) {
}
}
function OnBeginRequest(sender, args) {
$("#loadingText").html("<img src='_assets/img/animated/parweb_loading.gif' alt='' /> " + strLoadingText);
}
function endRequest(sender, args) {
}
</script>
the BODY section includes:
<asp:UpdateProgress AssociatedUpdatePanelID="pnlAllIn" runat="server" ID="pnlUpdating">
<ProgressTemplate>
<div id="loadingText" style="background-color: Red; position: absolute; width: 200px;
top: 0px; right: 20px; padding: 5px; color: White; text-align: center; vertical-align: middle;
font-size: 14px;">
</div>
</ProgressTemplate>
</asp:UpdateProgress>
Thank you for any assistance!