Hey Reader,
A common query I come across is about handling forms in Blazor Static Server-Side Rendering (SSR). Is it feasible to use Blazor's default EditForm without engaging any new interactive render modes? Absolutely, it is.
I've put together a detailed guide on how to effectively utilize the EditForm, along with the traditional HTML form element. This allows for the use of buttons independent of a model. Plus, Iāll walk you through enhanced navigation techniques like fixing the scroll position for a smoother user experience. Check it out!
To employ the EditForm in Blazor SSR, it's crucial to implement the new FormName parameter in the EditForm component and incorporate the [SupplyParameterFromForm] attribute in your model. For handling multiple forms, youāll need to specify the form name as well.
If your goal is to integrate a button without tying it to a model (a requirement in the EditForm) and bypass interactive render modes like Server or WebAssembly, simply encase it within a standard HTML form tag.
In a scenario where this form is within a foreach loop, notice how Iāve assigned a distinct name to each form using the character.Name property. This is essential for uniqueness, just like in the EditForm. Donāt forget to include the AntiforgeryToken component and observe how enhanced navigation is achieved by adding data-enhance. For the EditForm, just add Enhance, and you're all set.
That's it for today, Reader.
Hope you have a fantastic weekend!
Any queries or need further explanations? Feel free to respond to this email, and Iāll be more than happy to create additional tutorials for your assistance.
A huge shoutout to our amazing community and a massive thank you to my Patrons for your unwavering support. You are the true heroes of this newsletter and my channel. Looking forward to our continued journey this year.
Stay healthy, and always remember, the fun is in the coding! š»
Take care,
Patrick
Become a .NET & Blazor expert with weekly tutorials featuring best practices and the latest improvements, right in your inbox.
Hey friend, We once spent five days in meetings debating a single delete button. Whiteboard sessions. A compliance guy nobody invited. A product manager who scrolled Slack for what felt like forever. And still no decision. Until Tom walked in on Monday morning, asked one question, and shipped it that afternoon. In this video, I tell the full story and walk you through the four questions that should end this debate on any team, in any codebase. Take care, Patrick P.S. We go deeper on exactly...
Hey friend, Most developers use AI the same way: send a prompt, wait, repeat. It works. But it's slow. And it leaves a lot on the table. In today's video, I show you the workflow I switched to: running multiple Copilot agents in parallel, each working on a different part of the app at the same time. It feels less like using a tool and more like managing a team. And with vertical slice architecture, it just clicks. Take care, Patrick P.S. Want to set this up for your own projects or team? I'm...
Hey friend, Quick heads up. I'm hosting the next .NET Web Academy Monthly Live Session on Thursday, and I'd love to see you there. Last time we had some really good discussions and great questions from the group. This one will be the same format: open, interactive, no slides, no webinar vibes. I'll share my screen, we'll dig into whatever is relevant right now in the .NET and AI world, and you bring your questions, your current project, or just show up and listen. š Thursday, April 30 CET:...