-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
In Blazor, a component is a .razor file containing a small, isolated piece of functionality (code and markup), which can be used as a page. A component can host other components as well.
There are three different ways we can create a component:
.razor fileIn this chapter, we will go through the different options. To begin, we'll go through the components in the template we used to create the project; these all use the first option, .razor files, in which we have a mix of code and HTML in the same file.
The components in the template are as follows:
Let's take a look.
The Counter page shows a button and a counter; if we click the button, the counter increases.
We will now break the page apart, making it easier to understand. The page is located in the BlazorWebApp.Client project, inside the Pages...