• 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.

  • Perform Javascript from codebehind with RegisterStartupScript

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

  • 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.

  • 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.

  • 404 pages in ASP.Net websites

    Creating a 404 page for an ASP.Net website isn’t hard. But it depends on when you want it to be showed and how it should be showed. I’ll explain the quick and simple way.

  • Execute code for a page after Master Page is loaded

    Sometimes you’d like to edit a public property or call a function of a Master Page from the currently requested page.

  • .Net MVC @helper in Razor view using C# and VB

    Creating reusable pieces of HTML with dynamic data for .Net MVC Razor made quick and easy with helpers.

  • Calculate difference between two dates in C# and VB

    Calculating the difference between dates couldn’t have been easier as in C# or VB. I’ll show you how in both languages and how to calculate the difference in years and months and more.

  • ASP.Net Gridview to Excel

    It’s easy to do this. Or at least, you’d think it is. But when you allow the columns to be generated automatically, you can run into a nasty error “The controls collection cannot be modified because the control contains code blocks <% ... %>”