I know there are many similar questions but I am kind of restricted in many terms for this case. I am using SharpBox to upload files to Dropbox and in order to create a progress bar visible to user, I am using a static method where SharpBox returns the percenatge. It is all fine but I need to return this information to the aspx page or javascript somehow.
I cannot add a parameter to the method. I could remove the static from the method however it does still gives an exception null on the label which is quite strange (probably because the method fires from SharpBox dynamically).
So the method UploadDownloadProgress is the part where I have problems with.
public class docUpload
{
static public void Doc_Upload()
{
dropBoxStorage.UploadFile(stream, filename, entry, UploadDownloadProgress);
}
static void UploadDownloadProgress(Object sender, FileDataTransferEventArgs e)
{
// I need the e.PercentageProgress on aspx page
System.Diagnostics.Debug.WriteLine(e.PercentageProgress);
// This wont work since it is a static method
myLabel.Text = e.PercentageProgress.ToString();
e.Cancel = false;
}
}
I need the e.PercentageProgress in the label. I also alternatively tried to call javascript without success. Could you suggest any other alternatives?