blazor-server-side

How to fix 'The current thread is not associated with the renderer's synchronization context'?

戏子无情 提交于 2020-05-13 04:54:14
问题 I am trying to change change a string, being used for a title, in my blazor-server-side application. But I am having trouble getting the UI to update. I tried using StateHasChanged(), but that didn't work so I looked around and found that on the FlightFinder Demo that was made, it has an OnChange event Action, so I am trying to implement that. It works until I try to refresh the browser, then I am hit with this error System.InvalidOperationException: 'The current thread is not associated with

How to fix 'The current thread is not associated with the renderer's synchronization context'?

佐手、 提交于 2020-05-13 04:53:51
问题 I am trying to change change a string, being used for a title, in my blazor-server-side application. But I am having trouble getting the UI to update. I tried using StateHasChanged(), but that didn't work so I looked around and found that on the FlightFinder Demo that was made, it has an OnChange event Action, so I am trying to implement that. It works until I try to refresh the browser, then I am hit with this error System.InvalidOperationException: 'The current thread is not associated with

How to fix 'The current thread is not associated with the renderer's synchronization context'?

二次信任 提交于 2020-05-13 04:53:08
问题 I am trying to change change a string, being used for a title, in my blazor-server-side application. But I am having trouble getting the UI to update. I tried using StateHasChanged(), but that didn't work so I looked around and found that on the FlightFinder Demo that was made, it has an OnChange event Action, so I am trying to implement that. It works until I try to refresh the browser, then I am hit with this error System.InvalidOperationException: 'The current thread is not associated with

Blazor concurrency problem using Entity Framework Core

家住魔仙堡 提交于 2020-05-11 11:06:28
问题 My goal I want to create a new IdentityUser and show all the users already created through the same Blazor page. This page has: a form through you will create an IdentityUser a third-party's grid component (DevExpress Blazor DxDataGrid) that shows all users using UserManager.Users property. This component accepts an IQueryable as a data source. Problem When I create a new user through the form (1) I will get the following concurrency error: InvalidOperationException: A second operation

Blazor concurrency problem using Entity Framework Core

妖精的绣舞 提交于 2020-05-11 11:02:19
问题 My goal I want to create a new IdentityUser and show all the users already created through the same Blazor page. This page has: a form through you will create an IdentityUser a third-party's grid component (DevExpress Blazor DxDataGrid) that shows all users using UserManager.Users property. This component accepts an IQueryable as a data source. Problem When I create a new user through the form (1) I will get the following concurrency error: InvalidOperationException: A second operation

Blazor 'Global' Parameter - passing between MainLayout.razor , NavMenu.razor, Counter.razor - back and forth

。_饼干妹妹 提交于 2020-05-09 06:47:12
问题 Given a 'default' Blazor app - created using the Visual Studio 2019 Blazor server template . How do you create a GLOBAL object that is accessible from all the razor pages and components. How would you make the 'Current Count ' value - visible and 'dynamically' updated on the MainLayout, NavMenu, Index pages? Current count: @currentCount Use [Parameters] ? Use [CascadingParameter] ? Create a Static Class ? What is the recommended approach in Blazor? 回答1: One way to do this is to is to use a

Blazor (Server Side) and Okta

倖福魔咒の 提交于 2020-05-09 06:09:39
问题 I am currently going through this post to integrate okta into a Blazor Server Side App https://developer.okta.com/blog/2019/10/16/csharp-blazor-authentication I am currently getting “Sorry, there's nothing at this address”. I was hoping someone could provide a suggestion to my problem. Or does anyone know of an example to integrate okta into a Blazor Server Side App? Please let me know. Any help would be appreciated. I am totally spinning my wheels. Here are my okta General Settings: Below is

How can I get the event while page close in blazor server-side?

我的未来我决定 提交于 2020-05-08 12:50:06
问题 I am making a chatroom App by the blazor server-side. I want to show the online state of each user. Now I can use the OnAfterRenderAsync event to get a user has entered the page. It seems there is not any exit event in blazor lifecycle via https://docs.microsoft.com/en-us/aspnet/core/blazor/lifecycle?view=aspnetcore-3.1 Someone said I can use the Dispose event to achieve it while it does work at all. What's more, I have a crazy idea that using the window.onbeforeunload event of js to invoke

How can I get the event while page close in blazor server-side?

夙愿已清 提交于 2020-05-08 12:49:28
问题 I am making a chatroom App by the blazor server-side. I want to show the online state of each user. Now I can use the OnAfterRenderAsync event to get a user has entered the page. It seems there is not any exit event in blazor lifecycle via https://docs.microsoft.com/en-us/aspnet/core/blazor/lifecycle?view=aspnetcore-3.1 Someone said I can use the Dispose event to achieve it while it does work at all. What's more, I have a crazy idea that using the window.onbeforeunload event of js to invoke

How can I get the event while page close in blazor server-side?

|▌冷眼眸甩不掉的悲伤 提交于 2020-05-08 12:49:27
问题 I am making a chatroom App by the blazor server-side. I want to show the online state of each user. Now I can use the OnAfterRenderAsync event to get a user has entered the page. It seems there is not any exit event in blazor lifecycle via https://docs.microsoft.com/en-us/aspnet/core/blazor/lifecycle?view=aspnetcore-3.1 Someone said I can use the Dispose event to achieve it while it does work at all. What's more, I have a crazy idea that using the window.onbeforeunload event of js to invoke