Greg Shackles

Navigation

Consuming iCalendar Events with PowerShell

One of the cool benefits you get with PowerShell is the ability to make use of external .NET assemblies. Lately I found myself wanting to do some scripting involving an iCalendar feed, and since I hate writing console applications every time I have some small task to perform, PowerShell seemed like a good choice. While there is no built-in support for consuming iCalendar files, the ability to augment it with an assembly meant that I could…

Using IronPython to Enforce Code Conventions in Visual Studio Builds

Recently I was reading a blog post by Scott Guthrie about the new syntax for HTML encoding output in ASP.NET 4, where he said the following: This enables you to default to always using <%: %> code nuggets instead of <%= %> code blocks within your applications. If you want to be really hardcore you can even create a build rule that searches your application looking for <%= %> usages and flags any cases it…

Templated Helpers and Custom Model Binders in ASP.NET MVC 2

One of the really cool new features in ASP .NET MVC 2 is templated helpers. The basic idea is that you can define a template for either displaying or editing a particular data type, and it will be used by default when displaying or editing that type. This allows you to define the behavior once, and then you don’t need to worry about it in every view you write thereafter. In this post I’ll…

LINQ for JavaScript: Using and Extending JSLINQ

If you’re a developer in the .NET realm, you have undoubtedly learned to use and love LINQ for dealing with collections. If you haven’t, then what are you waiting for? In this age of AJAX powered sites, managing collections of JSON objects becomes a very common pattern. I found myself wanting to apply LINQ-like operations to those collections, and decided to see what was out there before writing my own. Unsurprisingly, it turns out…

Validating Hidden Fields in ASP.NET MVC 2

One of the many nice things they have added in MVC 2 is model/view model validation on both the client and server side. I won’t go into the basics here since they have been covered extensively by others. However, recently I was adding validation to require a value for a hidden field on a form, and found that the default validation functionality just didn’t work on the client side for a hidden field.…