Add Headers To A Response In ASP.NET 5

Add Headers To A Response In ASP.NET 5

Hey folks, this is a short but crucial blog post for anyone writing custom middleware for ASP.NET. In this post, we’ll see how we can correctly add headers to an HTTP response and avoid the dreaded System.InvalidOperationException error.

Enrich HTML With ASP.NET Razor TagHelpers

Enrich HTML With ASP.NET Razor TagHelpers

Have you ever wanted to enrich HTML server-side before reaching the client? Of course, you have! The idea of declaring behavior and then having the tedious parts handled by a framework is what most developers want.

Read And Convert QueryCollection Values In ASP.NET

Read And Convert QueryCollection Values In ASP.NET

I recently worked on a proof of concept library that involves access to the web request at the HttpContext level. The library I’m building needs to register endpoints, and these endpoints need to process basic query string parameters. Fundamental stuff,...

Serialize Interface Instances With System.Text.Json

Serialize Interface Instances With System.Text.Json

On the spectrum of “chill” languages, JavaScript is on the higher end of permissible syntax. The ability to patch together a disparate group of values and treat them as one collection can help developers “get stuff done”. C# and .NET...

Remember ASP.NET Request Culture Using Middleware

Remember ASP.NET Request Culture Using Middleware

In the last post, we explored a jumpstart guide to working with a user’s request culture. While localization works out of the box, there seems to be a caveat when it comes to remembering the culture a user prefers.

ASP.NET Core Localization Jump Start

ASP.NET Core Localization Jump Start

Language is a core component of the human condition. According to the Washington Post, at least 50% of the world’s population is bilingual. That’s a fantastic statistic, that means every second user to our application could be bilingual. Sadly, most...

Remove Rows From Razor HTML Tables

Remove Rows From Razor HTML Tables

The tried and true spreadsheet is the king of all business application user experiences. On the web, we’ve been able to recreate and dress-up the spreadsheet experience using HTML table tags. It’s a common design choice in many create, update,...

Use TempDataAttribute For Clean Code

Use TempDataAttribute For Clean Code

In a previous post, I wrote about solving the form resubmission confirm issue that many developers run into when building web applications. In ASP.NET MVC, we have many tools at our disposal to pass information from one method to another,...

Use Select Dropdown In ASP.NET Razor

Use Select Dropdown In ASP.NET Razor

ASP.NET’s Razor engine comes with an assortment of HTML tag helpers. Some of the helpers are straightforward, while others may be challenging for folks to grasp. One of the more powerful HTML elements is select, allowing us to select a...

Building HTML with C#

Building HTML with C#

Hypertext Markup Language is the first programming language many of us learn. Like chess, it’s easy to learn but can take a lifetime to master. Its declarative syntax is ideal and ubiquitous across many different ecosystems, and C# embraces it...