Blog posts

179 results found

179 results in .NET, Community, Umbraco

tools·dotnet LINQPad

I recently came across this fantastic resource. It is called LINQPad. You can use it to test any C#, F# or VB snippet or program. You can even use it to query databases in LINQ or SQL. It's ideal if you find some code on the internet that you want to quickly test, or if you want to play with the new features in C# 6 without having to set up a windows console/forms app or website.

dotnet MVC client side form validation

This post shows you how you can do client side, unobtrusive validation on your MVC form. It assumes you have already set up your Model, View and Controller, but you just need to know how to get it to validate on the client side.

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

dotnet Get a flat list of exception and inner exception error messages

Debugging errors can be difficult, especially when you need to see the errors inside the errors. This post shows you how you can get all errors as a collection of errors rather than them being hidden inside other errors. You can create an extension method like this one

umbraco XML Sitemap in Umbraco website

This post shows you how to create an XML sitemap in your Umbraco website. I will share the code I have used to create my XML sitemap page http://www.codeshare.co.uk/xmlsitemap You will need an XML sitemap when you submit your site to search engines.

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

dotnet Sorting a list into random order using linq

Every now and again, there is a need to produce a list in a random order. I've found a very reliable way to do this using linq and the Guid class. It might sound complicated, but when you see the example, it should make sense and you should see how simple it is.

dotnet List ForEach Method

You may or may not be aware of the .ForEach() Method which is available on List<T> objects. It is very handy for shortening your code. Lets say you want to write a method which returns a list of MailAdress objects. A more traditional way would be to do the following:

umbraco Umbraco Alternate Template Feature (bug)

There is an annoying feature in Umbraco which, when not wanted, seems like a bug. If you want to view a page with a different template, you can enter the url/templateAliasName

dotnet Null-coalescing Operator

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

umbraco Allow any markup in the TinyMCE editor

If, like me, you find it very annoying that Umbraco seems to stop you from entering whatever markup you want to put in the editor, then this post should help you.