Blazor
That Experimental Framework based on WebAssembly.
-
The Error AspNetCore.Components.Forms Requires value for ‘ValueExpression’ on a Blazor Page
What the hell is that? Let’s start with the full error throw from our Blazor Page: Microsoft.AspNetCore.Components.Forms.InputText requires a value for the ‘ValueExpression’ parameter. Normally this is provided automatically when using ‘bind-Value’. It’s here we see this in our little Blazor .Not 6 App: On our page we must have a @bind-Value that has gone off the tracks. Yes we do. Here’s the page Razor code in a EditForm – do you see the problem? <EditForm Model="hero" OnSubmit="HandleSubmit"> <div> <label for="FirstName">First Name</label> <InputText id="FirstName" @bind-value ="hero.FirstName" class="form-control"></InputText> </div> <div> <label for="LastName">Last Name</label> <InputText id="LastName" @bind-Value="hero.LastName" class="form-control"></InputText> </div> <div> <label for="HeroName">Hero Name</label> <InputText id="HeroName" @bind-Value="hero.HeroName" class="form-control"></InputText> </div> <div> <label>Comic</label><br /> <InputSelect…
-
Blazor with dotnet watch run in the Pre-Dotnet 6 and VS 2022 days
Oh, how we do wait for the release of dotnet 6 and most important VS 2022. Why? Well the promise of hot-reload without hoops to jump through. For the most part in VS 2019 16.10.4, “hot-reload” of a Blazor app is not too bad <= Circle that “not too bad”- it does actually work… mostly! Yes, I do refer to the “dotnet watch run”. It does detect changes in your Blazor files and reload the browser page… yeah, BUT it does have issues. Here comes the list…. It doesn’t detect new files added… go ahead add a new razor page while your project is in “dotnet watch run” – nope…
-
The Server Side Blazor and SignalR Timeout
So in my Blazor travels I ran across one (or another) annoying thing. In this one we will talk about that Server -Timeout? Disconnect? Retry? Not really sure which one it is. This affects Blazor Server Side where SinalR is being used between the browser and server side code. I came across some Javescript that can go into the _Host.cshtml file. <script> // Wait until a 'reload' button appears new MutationObserver((mutations, observer) => { if (document.querySelector('#components-reconnect-modal h5 a')) { // Now every 10 seconds, see if the server appears to be back, and if so, reload async function attemptReload() { await fetch(''); // Check the server really is back…
-
Blazor: And the Identity Scaffolding Mess
Ok, back around to the annoying bin. Let’s talk adding Identity to a Blazor Web Assembly app… Out of the box when you start with a Blazor WebAss project using Identity and of course ASP Core hosted (I’m using preview 2). You then decide that all of the hidden razor pages really need to be customized (don’t even get me started on Hidden razor pages). Well there is a way to do just that. You Add Scaffolded Item to the Server project and select Identity (nope not going to show you that- there’s plenty of how-to on the internet). I wait while you go figure out how-to do that…… Wait …
-
Blazor and EF Core to Nowhere land.
In the long decent into “Experimental” frameworks- this one being Blazor, I’ve been finding some challenges with getting Blazor to work with the latest EF Core. There’s a few examples of Blazor being used with EF Core (i.e. the CRUD example that’s floating around the inter-Tubes), but nothing that seems to work with the latest Blazor Lang template in the latest VS release. One can go to a lower EF Core version, well mostly… I’ve yet to get my Blazor Hosted Core test app to compile…. let alone the DB-Context to Scaffold… it just spews errors no matter which direction I go in… Oh Bother…. I have to remember that…



