Пользовательский интерфейс Blazor задерживался при вызове функции асинхронного ожидания ⇐ C#
-
Anonymous
Пользовательский интерфейс Blazor задерживался при вызове функции асинхронного ожидания
I am using Blazor (web app) with .NET 8 and a dropdown (with MudBlazor). When the user chooses an item from the dropdown, I call an await function to the backend. The problem is it got delayed a few seconds after the user clicked on the dropdown to display the item name on the dropdown. I tried to remove the await function and it worked normally. Does this relate to the threading of Blazor? The code looks like this:
protected async Task OnValueChanged(Vessel selectedVessel) { // Do something var info = await GetMoreVesselInfo(selectedVessel.Id); // Display more info on the map }
Источник: https://stackoverflow.com/questions/781 ... t-function
I am using Blazor (web app) with .NET 8 and a dropdown (with MudBlazor). When the user chooses an item from the dropdown, I call an await function to the backend. The problem is it got delayed a few seconds after the user clicked on the dropdown to display the item name on the dropdown. I tried to remove the await function and it worked normally. Does this relate to the threading of Blazor? The code looks like this:
protected async Task OnValueChanged(Vessel selectedVessel) { // Do something var info = await GetMoreVesselInfo(selectedVessel.Id); // Display more info on the map }
Источник: https://stackoverflow.com/questions/781 ... t-function
Мобильная версия