Programming

ASP.NET MVC Widgets with RenderAction

Posted on

This is a useful pattern that I have successfully employed a couple of times with ASP.NET MVC applications; creating Widgets with RenderAction. The prevalent way to create a page in ASP.NET MVC is to grab a bunch of stuff in the controller and pass it into a view to be rendered. As the application grows, […]

Programming

ASP.NET MVC Image Squishing with Picz

Posted on

Responsive images have been around for a while and have wide browser support as well as a strong fallback story for older browsers. The one thing holding us back from using them is the manual workflow… Arrive at office Create images at different sizes Upload images Write an HTML tag listing all the image sizes […]

Programming

Translating Your ASP.NET MVC Routes

Posted on

There are a ton of ways to localize your ASP.NET MVC application when it comes to the text your display on the page. When it comes to the URLs, though, it is not uncommon to see a site in one language with routes in another. It seems a real shame to see a website in […]

Programming

Request and Response Class Splitting

Posted on

This is something I don’t seen done a lot in real life, so I thought I’d write briefly about it. This topic gets a lot of talk, but not much action and in reality I think schedule pressures are the most likely reason for this refactoring (and most others) never actually get considered. I’m talking […]

Programming

Testing Your MVC Routes

Posted on

Everyone knows that is much easier to test a controller in MVC than it was to test “code behind” in Web Forms, but it is really easy to forget that routing rules are a rather important chunk of your logic. If the routing isn’t right, everything else fails. So you ought to be testing your […]

Programming

Adding Unity to Your Web API Project

Posted on

Adding Unity V3 to your ASP.NET Web API project is so easy it very nearly hurts. Despite this, I can foresee a couple of “duh” moments if you don’t spot a couple of minor details. To get started, you just open up the NuGet package manager, search online for Unity and select the appropriate version […]