From the course: Blazor WebAssembly: Building Your First App

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Create a Razor component

Create a Razor component

- [Instructor] One of Blazor's core components is Razor components. A Razor component contains the UI for a certain part of a Blazor application. It can be used for UI display, as well as the processing logic and functionality for a mixture of HTML and C# markup. Razor component files have the extension name of .razor and can be used across different parts of the application. Their file name must start with a capital letter, and the file name will represent the ID of the component, minus the extension name. Looking at our Blazor application, I have a couple of Razor components already added. I have the main App.razor, alongside a couple of layout components. I know that they're Razor components as they have the .razor extension. However, I don't have any pages. Let's correct that. I right-click on the Pages folder, go to Add, and go to Razor Component. Throughout the rest of this course, I'm going to be creating an…

Contents