private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
await ProcessUploadAsync(e);
MessageBox.Show(“Upload completed…”);
}
When upload is completed, the messagebox only shows when a user clicks, resizes or otherwise does something else on the screen.
I’ve tried many many different approaches (eval, timer, client side js) but nothing works (all of these only works after user action).
I’m stuck on this, does anyone have any suggestions?
Hi,
Looks like you have WebSockets disabled? you can verify that by checking the Console in DevTools or checking Application.IsWebSocket.
If that’s the case, you’ll need to do the following modifications:
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
Application.StartPolling(100);
await ProcessUploadAsync(e);
Application.Update(this, () =>
{
MessageBox.Show("Upload completed…");
Application.EndPolling();
});
}
HTH,
Alaa
You need to use Application.Update()
Documentation: https://docs.wisej.com/api/wisej.web/general/application#update-context-action
You could do it like this:
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
await ProcessUploadAsync(e);
MessageBox.Show(“Upload completed…”);
Application.Update(this);
}
But ideally, you would put the MessageBox call inside the Application.Update() call to insure that the UI is updated when the call ends.
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
await ProcessUploadAsync(e);
Application.Update(this, () => { MessageBox.Show(“Upload completed…”); });
}
Please login first to submit.