Category Archives: ASP.NET

ASP.NET MVC: Building Web API’s with HeaderValueProvider

A friend of mine who is involved in a local start-up here in MPLS was talking to me about how his start up is building their web api. Their start-up is a mobile application that has a back end data store that they’re communicate with via a REST-esque API build using ASP.NET MVC, hosted on…

ModelBinding ASP.NET MVC and Multiple Field Validation

This tip comes to you from my blog, but the hat-tip goes to Andres Nelson whom I work with at my current client who actually showed me how to do this. The Scenario You have a grid with multiple fields. These fields are dependent upon each other. If one field is empty, then the other…

ASPNET MVC: Handling Multiple Buttons on a Form with jQuery

Sometimes your task in MVC involves many buttons in the same form. Such as the screen shot here. What happens in most situations is that you end up having some code that kind of looks like this: … and then the code looks like this We can solve this with a little jQuery. By attaching…

MVC: Unit Testing Action Filters

Certain parts of ASP.NET MVC can be a real pain to test. Namely Model Binders, Action Filters and anything that relies on some magic “Context” that seems to derive from HttpContext, ControllerContext, RequestContext, etc. Below, I’ve outlined how I’ve unit tested a Action Filter. You could extrapolate some of this code into a base Test…

No IE6 ActionFilter for ASP.NET MVC

*** Update ***: I’ve also created a cheap jQuery plugin for this as well. See the bottom of the post There’s a lot of talk on Twitter today about IE6. I’m building a web application in my free time and I didn’t want to support IE6. Will I lose users? Yes, a few, but I…