-
Book Overview & Buying
-
Table Of Contents
GUI Programming with C#
By :
A new page will need to be created to utilize this component. Let’s create a new page under the name TemperaturePage.razor. The temperature converter component can be used on this page in this fashion:
@page "/temperaturepage"
<h1>Welcome to the Temperature Converter Page!</h1>
<TemperatureConverter />
@code {
// Any additional C# code needed for this page
}
In this example, the tag for the temperature converter component is <TemperatureConverter />. Upon the identification of this tag by Blazor, the temperature converter component will be rendered in its place.
Keep in mind that the component must reside within the same project or a referenced project. If the element is located in a different namespace, @using must be included at the top of the file, specifying the component’s namespace.
Additionally, ensure that the route defined in the @page directive (/temperaturepage in this case) is exclusive...