Blazor Cascading Values and Parameters

This blog is going to explain how to pass values from parent component to child component. A cascading parameter and component is an easy way to flow data from parent to child components. Basic Cascading Parameter and Component I have created two components to illustrate the data flow Parent.razor and Child.razor. The following is a… Continue reading Blazor Cascading Values and Parameters

Developer Exception Page in ASP.NET Core

The developer exception page is a one of the error handling processes in ASP.Net Core. It will give you complete details about the exception. To enable the Developer exception page app.UseDeveloperExceptionPage(); should be added in Configure method in Startup.cs file. The  app.UseDeveloperExceptionPage(); must appear before the middleware  which needs to handle the exception. public void… Continue reading Developer Exception Page in ASP.NET Core

Basic Event Handling in Blazor

This article is to explain how event handling works in Blazor. The @on{event} attribute in Razor is the event handling attribute. The {event} may be any event. For example, For button @onclick is a click event. In checkbox @onchange is a change event it will trigger, when checking or unchecking the checkbox. The following is… Continue reading Basic Event Handling in Blazor

Turn on CircuitOption.DetailedError in Blazor

This article is going to explain how to enable CircuitOption.DetailedError in the development environment. Let us look at a small example. The following is the Blazor component code. It contains both HTML and @code block. GetArray() method is defined in the @code module. In it, the array is initialized with four elements.  Finally, arr [5]… Continue reading Turn on CircuitOption.DetailedError in Blazor

ASP.NET Core Service Scope

Singleton vs Scoped vs Transient This article describes the service scope in ASP.NET Core and the difference between AddSingleton, AddScoped and AddTransient  methods. Let us see the following example that shows the lifetime of the services The following is an interface. This interface only returns a string unique ID (GuidID). IRepository.cs public interface IRepository {… Continue reading ASP.NET Core Service Scope

Service Injection into View in ASP.NET Core

This blog is about how dependency is injected directly into view. Let us look at it using a small example. The following is a ColorListService class that returns a list of strings. Note Put all your services in a separate folder called Services. So this will help you maintain a project structure ColorListService.cs public class… Continue reading Service Injection into View in ASP.NET Core

Group DropDownList Options in ASP.NET Core

This blog explains how to group options in a DropDownList in ASP.NET Core. Let’s look at it with an example. This example is going to bind the list of movie names grouped by the release year with the Selected Tag Helper. The following is the MyViewModelSample class. It has two properties, SelectedMovieID and MoviesList. The… Continue reading Group DropDownList Options in ASP.NET Core

Populating Dropdown using Dependency Injection into View in ASP.NET Core

This blog explains how to load a drop-down list in View using a dependency injection, without passing the value from the controller. So that it will reduce the request to the controller. Let us see how to achieve this. In this blog I have explained two types of drop-down list loading methods. The first one… Continue reading Populating Dropdown using Dependency Injection into View in ASP.NET Core