Using @page directive we can define a route for blazor components. Now, we can create a new Blazor Component and at the top of the HTML of this blazor component, add simply @page 'path', like this:
@page '/'
This is for the home page or for those requests there is no URL parameter after domain but suppose we want to open new component and URL must be like 'https://domain/counter' so just add like this:
@page '/counter'
Posted Date:- 2022-02-24 09:07:04
What is the component in Blazor?
What is Blazor WebAssembly (WASM)?
Can I debug Blazor WebAssembly?
Can I use both Blazor WebAssembly to build full-stack apps?
When should I use Blazor Server vs Blazor WebAssembly?
How to deploy a Blazor app in IIS?
How to deploy the Blazor app in Azure?
What are templated components in Blazor?
When should I use Blazor WASM?
When should I use Blazor Server?
What are the life cycle methods of Blazor Components.
What is the Event-Binding in Blazor?
How to do Two-way Data Binding in Blazor?
How to define a route in Blazor?
What are the steps to create and run the Blazor WebAssembly App using CLI commands?
What are the steps to create and run the Blazor Server App using CLI commands?
What are the Pros and Cons of Blazor WebAssembly?
What are the Pros and Cons of Blazor Server?
What is the component in Blazor?
What are the Features of Blazor?