Dear RKM,
To perform long web operations without blocking the UI, such as uploading to the Azure Blob service, you can use the "async" version of the http calls, which are executed by the browser on a background thread and give a callback when they are complete. If you need to have a loop in order to make several calls in sequence without blocking the UI, you can use the async/await pattern, which makes it easy to call async methods in a loop while waiting for the callback before continuing the loop. When the execution is waiting for the result of an async call, the UI is not blocked and other operations can be performed.
Alternatively, to perform client-side tasks such as long calculations that cannot be done with async/await, you only have the following options:
- Block the UI but also force the UI to refresh by calling "Dispatcher.BeginInvoke(...)", as discussed in the following thread:
http://forums.cshtml5.com/viewtopic.php?f=4&t=1452 - You can for example display a "Please wait..." message and update the percentage of the progress.
- Create a "WebWorker" in JavaScript and make it do the background tasks that you want to do. You can do so by using the new CSHTML5.Interop.ExecuteJavaScript method introduced in Beta 7.2. You will find more information at the following URL:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workersThanks.
Regards,
JS-Support