Thoughts on .Net & Coding
.Net Articles, tutorials, reviews, code and more...
-
Display tabular data using QuickGrid for Blazor
Displaying tables or grids is one of the most common requirements in web applications. There are plenty of third-party grid components available for ASP.NET Core and Blazor. However, if you require basic tabular display with sorting, paging, and filtering abilities QuickGrid component developed by the Blazor team is all you need. In this article we will explore some of the features and abilities of QuickGrid.
-
Use API key authentication in ASP.NET Core
Developers often need to authenticate Web API calls at two levels. You might want to authenticate individual users while making an API call or you might want to authenticate the client that is trying to call an API. The former is can be implemented via a token based scheme and latter can be implemented using what is known an API key authentication.
-
Understand the new Blazor project template in ASP.NET Core 8
Recently Microsoft released .NET 8 that also included a good amount of enhancements to ASP.NET Core. As a part of the improvements Blazor got a new project template -- Blazor Web App. The new project template supports the newly added features including render modes and authentication. In this article we will look at the new project template and template options in Visual Studio 2022.
-
Use Endpoint Filters and Route Groups in Minimal APIs
ASP.NET Core Minimal APIs allow you to quickly create controller-less HTTP APIs with minimal dependencies. A minimal API typically has an endpoint URL and an endpoint handler. At times you want to intercept an endpoint handler so that you can add pre and post processing to the endpoint handler. That's where Endpoint Filters come into picture. When there are too many endpoints, it makes sense to group them using a common URL prefix. This is taken care by Route Groups. In this article we will examine both with a few examples.
-
Test APIs using Endpoints Explorer and .http files
ASP.NET Core web developers often need to test the controller based APIs and minimal APIs they add in their projects. Typically developers use tools such as Postman or Swagger for this purpose. Visual Studio 2022 now has tools that can come handy for quickly testing your APIs. This article explains these tools with an example.
-
Use protected browser storage in Blazor
In the previous article we learned to use sessionStorage and localStorage in Blazor apps. The localStorage object also has storage event that one can use to get notified when localStorage is modified in some way. In this article we will first discuss the storage event with an example. We will then learn to use what is known as Protected Browser Storage that is available exclusively to Blazor Server apps.
-
Use sessionStorage and localStorage in Blazor
Traditionally developers used cookies to store small pieces of information on the client machine. Although you can use cookies in Blazor apps, there is a modern and more handy alternative -- sessionStorage and localStorage objects.
-
Show cascading dropdown lists in Blazor
In the previous article we learned to cascading create dropdown lists in ASP.NET Core MVC. You might want the same functionality in Blazor Web Assembly apps also. That's what we are going to do in this article.
-
Show cascading dropdown lists in ASP.NET Core
Many years ago I wrote a few articles on displaying cascading dropdown lists in ASP.NET. Since this is a very common requirement while building web UIs it's worthwhile to see how cascading dropdown lists can be displayed in ASP.NET Core MVC also.
-
Group Dropdown list items in ASP.NET Core
Displaying a list of options in a dropdown list or a listbox is quite common in ASP.NET Core forms. You can use the Select Tag Helper to render a <select> element and its options. If you want to display a large number of options to choose from, it would be better to group those options to make it easier for the end user to make the selection. In this article we will learn two ways to group dropdown list items.