Injecting Custom HTML Attributes in ASP.NET MVC

Recently Stuart Leeks and I have developed a worrying pattern of having the same ideas at the same time. I’m starting to doubt we’re different people. Except he’s about a foot taller so maybe that’s aspirational from my side. Our latest coinciding of ideas was a way to automatically inject HTML attributes for fields rendered…


ASP.NET MVC: Supplying HTML attributes with EditorFor

My colleague Simon Ince and I recently discovered that we had been working on the same problem independently so we combined our efforts and have written a joint blog post on our team blog. The problem was something that I’d encountered in a number of blog posts that used modified editor templates (jQuery UI datepicker,…


ASP.NET MVC: Adding Html attributes in Templated Helpers (EditorFor)

Recently Simon Ince and Stuart Leeks independently started working on solving the same challenge in ASP.NET MVC. Once we realised this we combined our efforts and this blog post is the result. We’ll walk through our approach – and hope you’ll be as pleased as we are with the simplicity of the solution. We’re wondering…


ASP.NET MVC & jQuery UI autocomplete Part 2 (EditorFor)

I recently blogged about how to enable autocompletion of a text field using jQuery UI, and how to easily hook this behaviour up in ASP.NET MVC. In this post I’ll go a step further and show how to hook this behaviour up even if you are using Html.EditorFor. In the previous post, we specified the…


ASP.NET MVC & jQuery UI autocomplete

If you get me started talking about ASP.NET MVC then it is quite possible that I’ll end up talking about Progressive Enhancement or Unobtrusive JavaScript. Aside from the usability and performance benefits that these techniques can bring, I find that they also help me to write JavaScript in a more modular, more reusable way than…


ADM: Workshop: ASP.NET MVC 3 Development Ramp Up

Date: 3rd & 4thApril 2012 Location: Thames Valley Park, Reading   SinceASP.NET MVC was released many of our customers have been considering or arealready adopting it for their new applications. It builds on your .NET skillswhilst using a Model View Controller pattern implementation coupled with otherconcepts to provide a highly testable, powerful web development framework….


WebGrid extensions on NuGet

If you’ve not read my MSDN magazine article on using WebGrid to render tabular data then go read it now:! This post announces the NuGet package WebGridMvc that wraps up the custom WebGrid helpers. Why did I bother? Mostly because every time I’m talking about this stuff I have to remember where I put…


Templated Razor Delegates combined with Partial Views

I was with a customer in Germany this week, and just before I left one of the (rather talented I might say) developers asked me about passing markup into an HtmlHelper extension. It turns out this is pretty easy, as covered by Phil Haack under Templated Razor Delegates. However, I particularly like keeping my HTML…


Flexible Conditional Validation with ASP.NET MVC 3

What? My colleague Simon and I have each written conditional validators with a number of customers, and Simon has blogged about it a number of times. I’ve had another idea in this space that I’ve been meaning to post for a while. Simon’s most recent post gave me the nudge I needed, so if you…


Mvc.ValidationTookit Alpha Release: Conditional Validation with MVC 3

My blog posts on doing conditional validation in MVC have always been popular, and I’m frequently surprised by where I find that code – customers often say to me “we found some guys blog with some code to do the validation we needed” and sure enough it usually turns out to be mine! There are…