Jan 28, 2009, 4:07 PM
[CLOSED] How to show loading mask on the page while an Ajax function is processing?
I have a few long running processes that need to be executed sequentially in code and would like a loading mask to show on the page while they are processing. After each task is done, I would like to update a label on the page and then start the next task which then will show a loading mask while it processes, and so on until each task has been completed. Does anyone have a quick example or method for me? Thanks in advance...
<%@ Page Language="vb" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script runat="server">
Protected Overloads Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Label1.Html &= "<br />Page Load: " & Now.ToString
GetTimeStamp1()
End If
End Sub
<AjaxMethod()> _
Public Sub GetTimeStamp1()
Label1.Html &= "<br />1: " & Now.ToString
'now I want to update the label and show a loading mask while this task executes
Threading.Thread.Sleep(1000)
GetTimeStamp2()
End Sub
<AjaxMethod()> _
Public Sub GetTimeStamp2()
Label1.Html &= "<br />1: " & Now.ToString
'now I want to update the label and show a loading mask while this task executes
Threading.Thread.Sleep(1000)
GetTimeStamp3()
End Sub
<AjaxMethod()> _
Public Sub GetTimeStamp3()
Label1.Html &= "<br />3: " & Now.ToString
'now I want to update the label and show a loading mask while this task executes
Threading.Thread.Sleep(1000)
End Sub
</script>
<script type="text/javascript">
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Debug">
</ext:ScriptManager>
<ext:Label ID="Label1" runat="server"></ext:Label>
</form>
</body>
</html>