MVC Custom Model Property Validation Attributes

This post shows you how to create your own custom validation attributes in MVC. You can then decorate your model properties with them on your forms.

Read More

Null-coalescing Operator

Shorter code for using the value of a nullable object or another value if not.

Read More

Create a redirect page in Umbraco without editing the config file

If you or your client needs to be able to create short urls or links to other sites without wanting to add it as a redirect in the web config, then this is the post for you. You can create them as umbraco pages that act as fast links or redirects.

Read More

Creating members in Umbraco programmatically

This post gives you the code for creating members programmatically in Umbraco. When you use this code, you can pass in the member's username, name, email address and optionally you can pass in their password and optionally assign them to a role/group.

Read More

How to set up and configure error logging in .NET with log4net

This is a simple and straight forward tutorial on how to set up and configure error logging with log4net in your .NET application.

Read More

Simple Reusable .NET Caching Example Code in C#

Caching is important because it can speed up your website or application. Here is a simple example for you to take away and re-use:

Read More

Google maps javascript API example with a styled map and custom pin icon

A lot of websites use google maps to show their location, but they usually leave it with the default style. This post gives you the code I use to generate a map and shows you how to style it. It also shows you how to add a custom map pin icon.

Read More

Helper methods for retrieving web config app settings

This post gives you some examples of how you can check for errors when retrieving web.config app setting values.

Read More

How to create a custom styled twitter feed for your website

In this tutorial I show you how to create your own custom twitter feed for your website, which you will have full control over the styling, like the one I have on my about page. It also pulls through the follower count. This tutorial is meant for an MVC websit…

Read More

How do you use the try catch finally blocks?

I must admit, in the past when I just want some code to run, but it's not critical if it fails, I have written a try catch block which looks like this.

Read More