Subject: Progress monitoring on web
Date: 2012-10-08 21:10:55
From: Al Shenker
Source: progress-monitoring-web
----------------------------------------------------------------------

Do you have an example of monitoring the list download progress on a web page as opposed to a windows app. I would like to update a label with the current progress. Updating the label server-side in the progress event handler didn't seem to do anything. And I also tried calling a javasript function in the server-side progress event handler which would in turn update the label on the client. This worked to update the label, but only when the download was completed... negating the usefulness off progress monitoring.

I am using Pop3, thought I don't know that it matters. Here is my latest attempt to handle the progress event:

[code lang='vb']

Private Sub client_MessageListProgress(ByVal sender As Object, ByVal e As Pop3MessageListProgressEventArgs)

ClientScript.RegisterStartupScript(Me.Page.GetType, "updateScript", "updateProgress(" & e.Downloaded & ", " & e.Total & ", " & Math.Round(e.Percentage) & ");")

End Sub


[/code]


And the javascript function:


function updateProgress(index, count, pct) {

//alert('index: ' + index + ' count: ' + count + ' pct: ' + pct); // used to verify this gets called. It indeed is called once for each message in the list

document.getElementById('<%= lblProgress.ClientID %>').innerText = 'Downloaded: ' + index + ' out of ' + count + ' messages (' + pct + '% completed)';

}

 

Thanks! 

 

---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index