On a recent project I had to allow users to upload their memories. Memories are vague things and I had to enable users to upload and assign incomplete dates. They needed to be able to enter ‘The 90′s’ or ‘September 2000′ as well as complete dates ’1st Feb 2009′.
Read more…
Whilst working on the CMS I needed to be able to pass back the html a control will render when the user first adds it. The control doesn’t exist on the page yet as the sections are added via javascript. It was very easy to pass in StringWriter to the render function to get the html
Read more…
Been a bit quiet round here lately but not because I’ve not been working on it
I’ve been using it for a project at work and converting a lot of my stuff to be compatible with it. It’s running a site atm and doing well.
Alpha State
Mainly in alpha because things may yet change but the following all work
Read more…
Found this is microsoft official line on creating a singleton, much simpler than the normal GOF way
// .NET Singleton
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}
In my cms’ I usually have the option of creating controls from the database. This is just a simple use for reflection but allows me to add controls to page just by adding a new row. If its one of my controls it supports a persistance system that allows the control to save and restore itself easily.
Read more…
Keeping tree data in a database can be a nightmare. There are a number of techniques to achieve it but they are all either unwieldy on the sql side (multiple joins) or on the data side (binary trees). I needed an easy way to render a tree out in a single read from the db.
I achieved this by just having a path field in the table, ordering by it and then dumping it out with the following routine. Needs more work but ok for the mo
Would need to change to writer instead of StringBuilder and I need to sort out the items that appear at the top (would appear under the folders in a treeview) Read more…