blazor-client-side

Best way to share data between two child components in Blazor

泄露秘密 提交于 2020-07-09 12:07:17
问题 I have this code. <ParentComponent> <ChildComponet> @renderFragment </ChildComponent> <ChildComponetn> <GridComponent Data="@dataList"/> </ChildComponent> </ParentComponent> where @renderFragment is dynamically render componet and Grid componet is list of some data with actions like "add new", "edit record", "delete". If we click "add new", form for add new record is opened dynamically in @renderFragment and we want to refresh grid data after submit form but we don't know how to share some

Customizing the AuthenticationStateProvider in Blazor Server App with Jwt Token Authentication

做~自己de王妃 提交于 2020-07-02 03:05:39
问题 I've noticed that many developers subclass the AuthenticationStateProvider both in Blazor Server App and Blazor WebAssembly App wrongly, and more imprtantly for the wrong reasons. How to do it correctly and when ? 回答1: First off, you do not subclass the AuthenticationStateProvider for the sole purpose of adding claims to the ClaimPrincipal object. Generally speaking, claims are added after a user has been authenticated, and if you need to inspect those claims and tranform them, it should be

Customizing the AuthenticationStateProvider in Blazor Server App with Jwt Token Authentication

假装没事ソ 提交于 2020-07-02 03:05:38
问题 I've noticed that many developers subclass the AuthenticationStateProvider both in Blazor Server App and Blazor WebAssembly App wrongly, and more imprtantly for the wrong reasons. How to do it correctly and when ? 回答1: First off, you do not subclass the AuthenticationStateProvider for the sole purpose of adding claims to the ClaimPrincipal object. Generally speaking, claims are added after a user has been authenticated, and if you need to inspect those claims and tranform them, it should be

Blazor WebAssembly 3.1 Target Framework is missing

旧城冷巷雨未停 提交于 2020-06-28 07:19:27
问题 I created a .NET Core Web API and class library with .NET Standard 3.1. But when I try to create Blazor WebAssembly with 3.1, it automatically creates a 2.1 version - as seen here: This is my Blazor web and .NET Core 3.1 is not listed. I install the 3.1 version again but still not listing. I already have .NET Core 3.1 version on Web API and class library but I don't understand why I can not create Blazor 3.1. But when can I create blazor server side application as 3.1 but I can't create web

Blazor WebAssembly + Amazon Cognito

只谈情不闲聊 提交于 2020-06-23 12:36:27
问题 I would like to set up a Blazor client-side app with authentication through AWS Cognito . When I run the app I'm not redirected to a login page, instead the page says "Authorizing..." for a few seconds, while I get this error in the console: The loading of “https://blazorapp.auth.eu-central-1.amazoncognito.com/login?…Q&code_challenge_method=S256&prompt=none&response_mode=query” in a frame is denied by “X-Frame-Options“ directive set to “DENY“. This error page has no error code in its security

Growing TextArea in Blazor

泪湿孤枕 提交于 2020-05-31 02:43:42
问题 I need a text area that grows as the number of lines increases. As soon as lines are deleted, the TextArea should shrink again. In the best case with a maximum height. How it works with Javascript I could already read here: textarea-to-resize-based-on-content-length But in Blazor I have unfortunately, as far as I know, no "scrollHeight" available for the TextArea. (My problem relates to the Blazor framework, which allows browser frontend development using C# (+HTML/CSS) and not a desktop UI

Blazor WebAssembly: How to get UI to update during long running, non-async process

半腔热情 提交于 2020-05-30 11:25:49
问题 I have some complex calculations that take a while to do. (Yes, I know, client-side may not sound like the ideal place to do them, but there are good reasons for it.) I would like the page to update with results as the calculations progress. I can get the UI to re-render as the calculations progress, but not update the results correctly. Note that the calculations are not inherently async and wrapping them in Task.Run does not seem to help. Here is a simplified version of the code that

Blazor WebAssembly: How to get UI to update during long running, non-async process

别来无恙 提交于 2020-05-30 11:24:43
问题 I have some complex calculations that take a while to do. (Yes, I know, client-side may not sound like the ideal place to do them, but there are good reasons for it.) I would like the page to update with results as the calculations progress. I can get the UI to re-render as the calculations progress, but not update the results correctly. Note that the calculations are not inherently async and wrapping them in Task.Run does not seem to help. Here is a simplified version of the code that

Blazor WebAssembly: How to get UI to update during long running, non-async process

╄→гoц情女王★ 提交于 2020-05-30 11:21:00
问题 I have some complex calculations that take a while to do. (Yes, I know, client-side may not sound like the ideal place to do them, but there are good reasons for it.) I would like the page to update with results as the calculations progress. I can get the UI to re-render as the calculations progress, but not update the results correctly. Note that the calculations are not inherently async and wrapping them in Task.Run does not seem to help. Here is a simplified version of the code that

Blazor WebAssembly: How to get UI to update during long running, non-async process

£可爱£侵袭症+ 提交于 2020-05-30 11:20:32
问题 I have some complex calculations that take a while to do. (Yes, I know, client-side may not sound like the ideal place to do them, but there are good reasons for it.) I would like the page to update with results as the calculations progress. I can get the UI to re-render as the calculations progress, but not update the results correctly. Note that the calculations are not inherently async and wrapping them in Task.Run does not seem to help. Here is a simplified version of the code that