How to Use Code Behind for Blazor Components | 2 Solutions

Описание к видео How to Use Code Behind for Blazor Components | 2 Solutions

Usually, when we see Blazor components, the C# code handling the interaction for the component template is placed below the template within the same .razor file.

However, there are other ways to implement Blazor components. I will show two alternative approaches to splitting the template and the C# code into separate files.

00:00 Introduction
00:30 Reasons for Separating Code and Template
02:18 The Code-Behind Solution
04:02 Dependency Injection in Code-Behind
05:42 Inheriting from ComponentBase
07:26 Conclusion

🔥 C#/.NET Bootcamp: The Fundamentals & more (Code FRIENDS10 for 10% OFF)*
https://claudiobernasconi.ch/dotnet-c...

📌 .NET Developer Roadmap
https://claudiobernasconi.ch/learn-do...

📌 YouTube Playlists:
The FREE Blazor Crash Course:    • The FREE Blazor Crash Course (.NET 5)...  
C# Programming:    • How to Create Modern C# Console Appli...  

✅ SUBSCRIBE FOR MORE VIDEOS
Subscribe: 🔔 https://claudiobernasconi.ch/Subscribe

🚀 CONNECT & SUPPORT
Twitter:   / chbernasconic  
Blog: https://claudiobernasconi.ch
Newsletter: https://claudiobernasconi.ch/newsletter

* Affiliate Link: I earn a small commission at no additional cost

Комментарии

Информация по комментариям в разработке