Posts Tagged as C#

Better FindControl for ASP.NET

There is one main limitation with FindControl in ASP.NET: it only looks in the NaminingContainer of the control you are searching within. Here is a better, much improved version of…

Geocoding in C# using Google Maps

If you have ever worked on a project involving maps (such as Google Maps), the chances are you will need to get the longitude and latitude for an address or set of addresses that h…

Stripping Tags from HTML in C#

It's a common requirement to strip tags from HTML documents whether you are trying to extract plain text from HTML, or remove tags users have entered in text input fields or textar…

Efficient AVL Tree in C#

The AVL tree is a rigorously balance binary search tree with very fast and stable insert, delete and search times. I like the various .NET dictionaries but have been unimpressed by…

Event Broker for ASP.NET

The Event Broker is an implementation of the Observer pattern. The key benefit of an Event Broker is that it offers a loosely coupled mechanism to broadcast and receive events. Thi…

Symmetric Encryption in C#

Whenever I find myself needing to use a symmetric encryption algorithm, I always seem to write more or less the same code substituting whichever built in .NET cryptography class I…

Pager for ASP.NET MVC

I recently implemented a pager in ASP.NET MVC and thought it would be worth sharing. It uses fluent syntax - a technique I've not seen used much in MVC to solve similar problems so…

Recursive Select in C# and LINQ

To complement my post on recursive joins to create hierarchical structures, here's the opposite code to flatten a hierarchy by performing a recursive select in LINQ and returning a…

Priority Queue in C#

Priority queues are really useful for path finding algorithms like A*. Also, for applications like mobile games, memory management is still an important consideration. I have used…