Tutorials on ASP.NET Core, Blazor, jQuery, JavaScript, Entity Framework, Identity, WordPress, SQL, HTML & more


Model Binding in ASP.NET Core from Beginner to Advanced

Last Updated: May 17, 2022

Model Binding aspnet core

What is model binding in ASP.NET Core? It is a process to Extract Data from HTTP Requests and provide them to the arguments of Action Method. Models contain the data that forms the business logic of the app. They are basically C# classes that contain the data from a database or other data source.

In ASP.NET Core there are 2 most important topics dealing with Models:

  • 1. Model Binding – a process of extracting data from HTTP request and providing them to the action method’s arguments.
  • 2. Model Validation – a process to validate the Model properties so that invalid entries are not entered in the database.

In this tutorial you will learn about Model Binding process in details.

(more…)

Custom Tag Helper in ASP.NET Core

Last Updated: May 14, 2022

aspnet core custom tag-helpers

In the last tutorial we covered Built-In Tag Helpers in ASP.NET Core. Now we will learn to create Custom Tag Helper for transforming the html elements with C# codes. We will take a lot of examples so make sure to go through each of the sections on this tutorial.

This tutorial is a part of the series called Tag Helpers in ASP.NET Core. It contains 3 tutorials.

(more…)

Built-In Tag Helpers in ASP.NET Core

Last Updated: May 11, 2022

built-in tag helpers asp.net core

Many of the ASP.NET Core Tag Helpers comes pre-built in the framework and are represented as asp-* attributes. They perform tasks like enhancing forms, validation messages, designing layouts and so on. In this section I am going to discuss about the built in Tag Helpers for Form, Input, Select, Label, Anchor, Text Area elements, CSS, JS and Cache.

This tutorial is a part of the series called Tag Helpers in ASP.NET Core. It contains 3 tutorials.

(more…)

Introduction to Tag Helpers in ASP.NET Core

Last Updated: May 5, 2022

tag helpers introduction

What are Tag Helpers in ASP.NET Core ? Tag Helpers are reusable components in ASP.NET Core. They are used to perform "defined transformations on HTML elements" from C# codes before being rendered on the views. With Tag Helpers we can enable server-side code to participate in creating and rendering the HTML elements. The most commonly used tag helpers are asp-controller and asp-action which assigns the controller & action for generating the URL. Example: <a asp-controller="Shop" asp-action="Clothes">Buy Clothes</a> will generate HTML <a href"/Shop/Clothes">Buy Clothes</a>.

(more…)

How to Call Web API in ASP.NET Core [.NET 10.0]

Last Updated: August 19, 2026

aspnet core consume api

On my previous tutorial How to Create Web APIs in ASP.NET Core [RESTful pattern], I created a Web API from the beginning. Now I will call this API (i.e. consume the API) in another project known as client.

(more…)

How to Create Web APIs in ASP.NET Core [.NET 10.0 RESTful pattern]

Last Updated: August 18, 2026

api controllers aspnet core

Creating Web APIs in ASP.NET Core is simple and follows a few standard conventions. An ASP.NET Core Web API controller must include the following three requirements:

  1. Add the [ApiController] attribute - Apply the [ApiController] attribute to the controller class. This enables API-specific features such as automatic model validation, parameter binding, and consistent HTTP API responses, making it the recommended approach for building RESTful APIs..
  2. Inherit from the ControllerBase class - A Web API controller should derive from the ControllerBase class instead of the Controller class. ControllerBase provides the functionality required for handling HTTP requests and returning JSON or other API responses without the view-rendering features used in MVC applications.
  3. Configure Attribute Routing - Define routes using the [Route] attribute so clients can access your API endpoints. A common routing pattern is: [Route("someUrl/[controller]")]. Attribute routing gives you complete control over your API URLs and is the recommended routing approach for ASP.NET Core Web API development.

The controller of a Web API looks like:

(more…)

Areas and Routing in ASP.NET Core

Last Updated: May 2, 2022

aspnet core areas

The concept of Routing is very vast and I have covered it in 6 tutorials which are:

So make sure you cover each of these one by one.

ASP.NET Core Areas represent a functional segment of the application. It can be administration, billing, sales, etc. If our application becomes very large then it will have many controllers, Models & Views. We can create multiple Areas to distribute the application files into them. This will help us to manage our application in a better way.

(more…)

ASP.NET Core Routing Generating URLs

Last Updated: April 29, 2022

aspnet core generate url routing

The concept of Routing is very vast and I have covered it in 6 tutorials which are:

So make sure you cover each of these one by one.

(more…)

ASP.NET Core Attribute Routing

Last Updated: April 29, 2022

attribute routing aspnet core

ASP.NET Core Attribute Routing adds routes by applying C# attributes on the controller and actions methods. Note that if convention routes are also present then we can override them by adding attribute routes. This is because DOT NET gives preference to attribute routes.

(more…)

Learn ASP.NET Core Route Constraint in details with lots of examples

Last Updated: April 29, 2022

constraining-routes-aspnet-core

ASP.NET Core Routing Constraints restricts route matching to a set of URLs. This is done by applying different types of constraints or rules in the route patterns.

Let’s start understanding this topic by creating a simple example project.

(more…)