Learn to fetch() resources in ASP.NET Core
Making Ajax requests from the client side JavaScript code to the server side resources is extremely common requirement in web applications. Traditionally developers used XMLHttpRequest (XHR) object to accomplish this task. Although you can continue to use XHR there is a better alternative - Fetch API.
Posted On : 15 Jan 2023
Use MVC, Razor Pages, Blazor, API Controllers, and Minimal APIs in a single ASP.NET Core application
Usually developers create a new ASP.NET Core project based on a particular project template such as MVC or Blazor. But you are not restricted to a single development option. ASP.NET Core offers multiple development options and you can utilize them in a single project depending on your requirement.
Posted On : 06 Apr 2022
Twenty years of .NET
On 13 February 2022 .NET is completing its strong presence of 20 years. Microsoft and developer community is all set to celebrate this occasion in variety of ways. You can read more about their plans here. You can also take a look at what others are doing on Twitter here.
Posted On : 14 Feb 2022
Various ways of redirecting a request in ASP.NET Core
ASP.NET Core web applications often need to redirect a request to another resource based on some condition. There are multiple ways in which you can accomplish this task in ASP.NET Core MVC and Razor Pages. To that end this article discusses them with examples.
Posted On : 17 Jan 2022
Fluent interface and method chaining in C# for beginners
As a C# developer you expose functionality using classes and objects. Many a times the code required to accomplish a task using these classes and objects tends to be complex. In an attempt to reduce this complexity you might want to device a technique that makes your code more readable and natural. That is where Fluent Interface and Method Chaining can be useful. The remainder of this article discusses these techniques with simple examples. My aim is to quickly introduce you to these concepts. So, the examples are kept simple rather than building a full-fledge example.
Posted On : 12 Jan 2022
Dealing with JSON serialization and camel casing in ASP.NET Core
ASP.NET Core Web APIs and controllers often need to serialize JSON data to JavaScript clients. On the server side your C# classes typically use Pascal Casing to name properties whereas JavaScript code often uses Camel Casing for property names. Therefore it would be worthwhile to take a quick look at how ASP.NET Core serializes data in JSON format from Web API and MVC controllers.
Posted On : 10 Jan 2022
JSON to XML / XML to JSON conversion in .NET Core
JSON is a preferred format for transferring data over the wire in modern web apps. However, at times you need to deal with XML data format. Moreover, you might want to handle JSON and XML in the same application. For example, you might be receiving data in JSON from a Web API and then you might want to feed it to another service that expects input in XML format. Such situations are common when you are integrating old and new software systems.
Posted On : 29 Dec 2021
Your first app using ASP.NET Core 6 and Visual Studio 2022
If you are keeping an eye on the progress of ASP.NET Core 6 you are probably aware that .NET 6, C# 10, and Visual Studio 2022 have been released. There are lots of new things, small to big, added to the overall .NET family and I have discussed a few of them in my previous articles. In this article I will show you how to create your first web application in Visual Studio 2022. I assume that you are already familiar with Visual Studio 2019 and ASP.NET Core in general. This is going to be a quick introduction to give you a feel of the new IDE and project structure.
Posted On : 11 Nov 2021
Authenticate gRPC calls in ASP.NET Core
ASP.NET Core supports creation of RPC style services using gRPC. Once created you might also want to secure them by authenticating and authorizing the service calls. To that end this article discusses a possible approach to implementing authentication in gRPC services.
Posted On : 25 Oct 2021
Authenticate users using Microsoft account in ASP.NET Core
At times you want to integrate external logins with your ASP.NET Core applications. External logins include Microsoft accounts, Google, Facebook, or Twitter. When you use external logins, the login details such as user name and password aren't stored in your local database. They are stored in some external store and you are required to "get in touch" with that external source to authenticate your website users. In this article you will learn to integrate Microsoft Account based login mechanism in your ASP.NET Core web app.
Posted On : 11 Oct 2021