Skip to main content

Posts

Featured

Cascading Values and Cascading Parameters in Blazor

This blog is going to explain what Cascading values and Cascading parameters are. And it is going to explain with examples how to use them. You can easily transfer values from parent to child components using cascading values and cascading parameters. Let's look at a small example. There are two components: parent and child components. In the code below, a text box is included to get the value to send to child components. Added CascadingValue component with value attribute to send value. Inside the CascadingValue a child component was added to get the value. Parent.razor @page "/Parent" <h3>Parent Component</h3> Enter Value to Pass: <input type="text" @bind="@ValueToPass" /> <br /><br /> <CascadingValue Value="@ValueToPass">     <Child></Child> </CascadingValue> @code {     int ValueToPass = 100; } Below one is a child component code. Here the [CascadingParame

Latest Posts

Component Disposal in Blazor

Query String in Blazor

File Upload in Blazor Server ASP.NET Core 5.0

Cross-Origin Requests (CORS) in ASP.NET Core Web API

Local Storage in Blazor using Blazored

JavaScript Interoperability in Blazor

Entity Framework Core (EF) with SQL Server LocalDB

SignalR with JavaScript in ASP.NET Core MVC

View-Based Authorization in ASP.NET Core

Policy-Based Authorization in ASP.NET Core