Typical programmer... do I spend a week learning how to use a CMS or do I spend 3 months writing my own. Silly question really; I write my own!
ChgDoc is the result of those 3 months. I'd written a CMS before but this time I wanted to try to leverage as much code from other people as possible.
Question 1. Why not write it as an MVC app?
Good question my friend. Well, what do I get with ASP.NET MVC3? "Fancy Url routing" and "Razor View Engine". ASP.NET v4 supports Url routing (check the URLs for this site) and the Razor Engine can be used stand-alone.
void RegisterRoutes(RouteCollection routes)
{
routes.Clear();
routes.MapHttpHandler( "" );
routes.MapHttpHandler( @"{url}" );
}
This will direct all URL's to my ResponseHandler, which looks up the Response for the page which is a HTML template. Pass that into Razor...
string html = RazorEngine.Razor.Parse( "some html", model );
And there you have it. A CMS. Except for all the other bits of code sitting around it. I mainly wrote the CMS for my own use. If you want to use it, please feel free. I welcome any and all feed back. If you want some help getting started, give me a shout.
