Htmx Using Razor Components

I love the simplicity of Htmx and the dev experience of Razor Components, so today I’m going to show you how to use both of them together. We’re going to be using the standard .NET 8 webapp template, Razor Pages and layouts for the main pages, and Razor Components for the Htmx interactivity. This gives us the best of both simplicity worlds, using Razor pages for our overall app navigation and logic, and the templating an in-line code of Razor Components for our UX components....

August 30, 2024 · 4 min · 702 words · Me · 

On Troubleshooting

As a long time contributor to StackOverflow, the quality of posts are wide ranging. In the hay-day, a contributor could rack up tons of points by pointing low-effort posters in the right direction with a single line of code. Now I’m sure the majority of those questions could be (and are) answered by AI, which was trained on my answers. But I think troubleshooting is the hallmark of a great engineer....

August 23, 2024 · 2 min · 345 words · Me · 

Blazor Authentication Without Razor Pages

For a while now I’ve been using the standard ASP.NET authentication methods with customized Razor pages to match the style of my site. And while this works, it’s annoying to lose all the functionality of Blazor, especially when you pour hours of time into customizing the look-and-feel, only to need to recreate it in the Razor page. In short, the special sauce is a minimal API method hat accepts a POST form-encoded username and password, which I called internal_login:...

August 23, 2024 · 3 min · 499 words · Me · 

Blazor Magic Link

I wanted a quick Magic Link implementation for my Blazor app, so I cobbled together a solution. I took inspiration from a NuGet package (forgot which one), but it’s simple enough to do with a few methods. Generating the Magic Link When a user decides to log in with a magic link, you can call a method like this. I’m loading a lot of the email server config elsewhere in the service....

August 21, 2024 · 4 min · 726 words · Me ·