Blazor NET 8 Web App-PersistentComponentState with Per-Page Rendering
I have a NET 8 Blazor web app that uses per-page rendering (nothing set globally) which renders my nav bar and main layout statically on the server. I navigate to a razor component page that sets the render mode at the component level (@rendermode InteractiveWebAssembly). If I try to use PersistentComponentState inside OnInitializedAsync(), I get the following error:
How to automatically change a value in a inputbox by changing the checkbox?
I use .net8 and blazor.
If I click on the checkbox from active to inactive, the value should become 0.
If I click on the checkbox from inactive to active, the default value should be shown immediately.
The user must also be able to change the value too, in the inputbox (InputNumber)
.Is the NET 8 Blazor Web App Template Flawed
Is the template project which gets data for the weather page flawed in the sense that data is retrieved in the OnInitializedAsync() method?
How to create custom attributes to reference them in a page.razor, like @page etc
Project Structure: Blazor Automode, .Net 8
Blazor Landing Page from External Source with encrypted token
We are generating encrypted tokens for invitations sent to a user’s email. I need the user to be able to click on the link and land within my blazor app, have the token validated, and depending on the results either send the user through the Entra User Flow or send them to a 403 access denied.
Blazor NotFound and NotAuthorized not working in .net 8
I’m encountering an issue with .NET 8 and Blazor. The interactive render mode is set to Auto (Server and WebAssembly). The problem arises when I add NotAuthorized
and NotFound
; it fails to navigate to either my Login page or my NotFound page. Adding UseStatusCodePagesWithRedirects
allows me to navigate to one of the pages, but I require unauthorized requests to redirect to the login page and requests for non-existing pages to redirect to NotFound.
How dotnet know where _Imports.razor is?
When creating Blazor project with dotnet new blazor
_Imports.razor get created in Components directory. It’s working fine.
What is the minimal configuration for [Authorize] to work on Blazor template Home page?
I’m learning how authentication works in Blazor by playing around with a minimal implementation. I started with the Server template with auth “None” and the familiar Counter and Weather sample pages. I added a dummy AuthenticationStateProvider
as shown below and changed the RouteView
in Routes.razor
to an AuthorizeRouteView
without any additional configuration. I suspect this is where something else is required for the issue I’m having, maybe something to do with the special significance of the "/"
route.
Should AuthorizeView care whether IIdentity.IsAuthenticated?
To better understand how authentication works in Blazor, I’m playing around with a minimal implementation of AuthenticationStateProvider
. As expected, if I implement GetAuthenticationStateAsync()
like this, an AuthorizeView
displays the not-authorized content:
Looking for Best Practices when starting out a new Blazor Web App (dbFactoryContext) and any others
I have gone through multiple iterations of what I tend to implement as my project ‘stubbing’ since MVC. This has evolved with each new flavor of the technology and I’m attempting to do the same here. I’ve noticed some collision issues since .net 8 came out and my implementation of DI.