Custom 404 pages in ASP.NET Core for routes and static files

Back in February I wrote a post about how to deliver 404 pages while immediately dealing out the correct status message for ASP.NET applications. I gave a hint about ASP.NET Core and have improved my solution since. So, let’s call this post a follow-up in a trilogy of posts.

The absolute proper way to do 404 pages in ASP.Net MVC

Websites and webservices should return the proper HTTP status codes as response to requests, along with the possible proper body. When you’re a using ASP.Net MVC web application it can be a little tricky because of a configuration quirk I quite dislike and didn’t find much info about. They improved this practice immensely in ASP.Net Core web applications. So, I want to make this post to clear it up and get it all in one nice explanation and solution.

Serving other content in ASP.Net Response

You want to generate a file or serve a document other than HTML out of ASP.Net and want to give it all the correct headers and filename in the response? It requires only a few lines to get it done.

Living with illness

It now has been a year since I have fallen ill with AML (Acute Myeloid Leukemia). It has been a rough ride already, but everything is looking very positive!

Perform Javascript from codebehind with RegisterStartupScript

A piece of javascript can be formed within codebehind and registered to run after the page has loaded.

Getting the current datetime in XQuery for Transact-SQL

I had to insert the current datetime in a piece of XML which was stored in a Transact-SQL xml datafield. But the XQuery in Transact-SQL doens’t support ‘fn:current-dateTime()’. So we had to devise another solution.

Get name of month or day in C# and VB.Net

The DateTime class is very useful. But sometimes you just want to print out the name of the month or day you have the integer value of, without the hassle of creating a whole DateTime object.

Blocking right-click contextmenu on images with Javascript and within Fancybox

Blocking the right-click contextmenu isn’t advised nor user-friendly. But when the customer has expensive pictures, they want to make it hard to download them.

Change JQuery Flexslider current slide by external element

Two alternatives to changing the current slide of a JQuery Flexslider from a HTML element outside of the slider.

Using VB.Net and C#.Net reserved words as regular names

You can take away the meaning of reserved words to use them any way you like. But I don’t advise doing so unless it’s really appropriate to do so. For example, as an entry of an enumeration.