Menu

Post image 1
Post image 2
1 / 2
0

5 Blazor Web App (.NET 10) gotchas I learned building an admin dashboard from scratch

DEV Community: blazor·JuDev13·3 days ago
#ngWMc03D
#dev#fullscreen#component#enter#exit#article
Reading 0:00
15s threshold

I spent 3 weekends building a full admin dashboard template with Blazor Web App (.NET 10). No component library, pure C# and CSS. Here are the 5 things that tripped me up — and that I couldn't find clearly documented anywhere. 1. @typeparam T conflicts with the Razor source generator If you create a generic component with a single-letter type parameter like T , you'll get a cryptic CS0305 error pointing at a generated .g.cs file: Error CS0305: Using the generic type 'DataGrid<T>' requires 1 type arguments Enter fullscreen mode Exit fullscreen mode The fix is simple — rename your type parameter to something longer: @* ❌ Breaks *@ @typeparam T @* ✅ Works *@ @typeparam TItem Enter fullscreen mode Exit fullscreen mode And update all references in the component accordingly. Not obvious from the error message at all. 2. You cannot pass RenderFragment to an InteractiveServer component This one cost me a few hours.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More