In this Demo project, I have created the CRUD(Create,Read,Update,Delete) operation using asp.net core blazor. It has very simple Emp table with EmpId,Name,City,Country and Gender field.
It has the following features
1. Entity Framework using Code Fist for Insert,update,Read and delete functionality
2. FluentValidator for validation in Blazor
3. Implementation of Log functionality using log4Net in Blazor
4. Custom paging on Grid
Step 2: Create the page where you are going to read the query string data.
@inject NavigationManager nav
Num1 :@a <br />
Num2 :@b <br />
Sum of Two Num: <b>@c</b>
protected override void OnInitialized()
uri = nav.ToAbsoluteUri(nav.Uri);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("a", out var aVal))
a = int.Parse(aVal);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("b", out var bVal))
b = int.Parse(bVal);
c = a + b;
In the above code, we saw that we are using Microsoft.AspNetCore.WebUtilities namespace, which has the helper method i.e. QueryHelpers to extract the query string value. We have also injected the NavigationManager the url path of page.
In this small demo, we saw that how QueryHelpers method of Microsoft.AspNetCore.WebUtilities namespace simplified our code to read the query string in asp.net core Blazor.