Monthly Archives: January 2011

Custom Unobstrusive Jquery Validation in ASP.Net MVC 3

Introduction This post demonstrates how to add client side unobtrusive validation for custom validation attributes. I will use a real example, which is the client side validation of the Australian Business Number and Australian Company Numbers for registered companies in … Continue reading

Posted in ASP.Net MVC, jQuery | Tagged , , | 3 Comments

Lazy Loading and Virtual Proxy Querying in Entity Framework 4

I’ve been kicking the tyres on Entity Framework 4, and have become a bit ambivalent about a few of it’s features – lazy loading and the virtual proxy implementation. I’m using EF 4 code first in a service tier with … Continue reading

Posted in Entity Framework | Tagged , , | Leave a comment

WCFContext and Inversion of Control in WCF with Unity and ServiceLocator

Introduction In previous posts here and here, I have covered configuring Unity for MVC. I am going to build upon those posts and cover configuring Unity as an Inversion of Control (IOC) container for WCF, so that patterns such … Continue reading

Posted in ASP.Net MVC, Dependency Injection/Inversion of Control, Design Patterns, Unity, WCF | Tagged , , , , | 1 Comment

Applying unobtrusive jquery validation to dynamic content in ASP.Net MVC

The new unobtrusive validation features of MVC are great, but I was surprised to find that once the validators have been applied for a document, validators as a result of dynamic content will not be applied, even if you … Continue reading

Posted in ASP.Net MVC, jQuery | Tagged , , | 46 Comments

IOC Containers, HttpContext Managed Lifecycle and Disposable Objects

I like to use an IOC container to resolve web services in my controllers. I also like the IOC container to manage the lifetime of those services, so that my controllers are not fussed about having to dispose of things … Continue reading

Posted in ASP.Net MVC, StructureMap, Unity | Leave a comment

Configuring Entity Framework 4 ‘CodeFirst’

In this post I’m going to cover configuring Entity Framework “CodeFirst”. Custom column name Custom storage type Custom table name Data constraints Ignore a property Turning cascade delete off One to one mapping Inheritance Mapping Table per class heirarchy Table … Continue reading

Posted in Entity Framework, NHibernate | Tagged , , | 7 Comments

Arbitrary client side validation in ASP.Net MVC 3

With the new unobtrusive JavaScript validations libraries included in ASP.Net MVC, it has become just so easy to add validation to any client input field, whether or not the field is backed by a model that exposes data annotations. When … Continue reading

Posted in ASP.Net MVC | Tagged | Leave a comment