Where possible we have tried to avoid custom code in the starter kit, not least because it doesn't appear in the Umbraco Admin interface, but one of the great strengths of Umbraco is it's programmability, so we have added a little bit so you can see how it's done. 


There are a couple of ways you can add code to your umbraco site, you can create standalone assemblies and include them in the bin folder, when the site starts up you will then be able to reference your assemblies in other code, macros, partial views and templates.

you can also add code directly to the app_code folder of the umbraco site, this code will be complied by .net when the site starts, and has the added advantage (for us) of keeping the code all in one place. 

for the starter kit, there is some custom code in the app_code/localgov/ folder 


The AtoZ helper manages a cache for the site's A to Z index. you could just build an a-z page when the user requests it, but you would have to go and find each page beginning with a letter, and add it to your list, on a large site this could take a while. 

the AtoZ helper, allows you to request all the pages starting with a letter, and have them retrieved quicker.

If it is the first time an a-z is requested then the helper will build a cache of pages and return them to you, every subsequent request will get the list from the cache and be much quicker. 

the Helper also includes an EventHandler to invalidate the cache when a new page is published. 

Contact Form Surface Controller

A surface controller is a class that interacts with your page, they allow you to run custom code when a page is called or data is posted back, our surface controller simply takes the contents of a form and sends an email (if you have setup an SMTP server in you're web.config).

We would say if you are doing anything clever with forms and umbraco you should look at umbraco forms. which is a paid for add on but makes things way simplier.