2 pages tagged with "mvc"

DotLessResult - MVC ActionResult for dotless

May 23, 2011 - 298 words - 2 mins
I’ve recently had the need to generate dynamic css for a themable MVC web application. I considered using a basic homegrown templating mechanism, or repurposing Razor, but then found the dotless project on the interwebs. With the NuGet package it was relatively easy to get up & running, and I’ve… read more

Google Analytics Razor Helper

May 19, 2011 - 193 words - 1 mins
I experimented today with the Razor helper syntax to consolidate generation of the Google Analytics tracking boilerplate (in ~/App_Code/Helpers.cshtml): @helper GoogleAnalyticsTracker(string analyticsId) { if (!String.IsNullOrEmpty(analyticsId)) { <script type="text/javascript"&… read more