I have a UserPopup with 2 buttons and one of them has async /await click event. I have to click twice to make it close:
private void btnClose_Click(object sender, EventArgs e)
//This closes on first click
private async void btnOK_Click(object sender, EventArgs e)
//This does not close on first click
Please take a look at it.
Thank you for your help,
That’s because await exits the method so the response is terminated and Task.Delay() spawns another thread.
Add Application.Update(this); to push the update back to the client.
When you see it working on the second click is just because it’s also sending back the pending changes as soon as there is another request. The same would happen if you click anywhere else. Wisej makes it looks like a desktop app but on the web you still have the request/response cycle.
Please login first to submit.