Tag: ASP.NET MVC
Ensure Controller actions/classes have authorisation
A couple of years ago I wrote a unit test to ensure that all our controller actions (or Controller classes) had appropriate authorisation set up. This ensures...
Custom routing to support multi-tenancy applications
The company I currently work for has many brands so they are looking for a website that can be restyled for each brand. They also want the styling information...
Changing the default Assembly/Namespace on an MVC appliction
TL;DR When getting an error message like this: Compiler Error Message: CS0246: The type or namespace name 'UI' could not be found (are you missing a using...
Code Review: Making a drop down list out of an enum
I’ve come across code like this a couple of times and it is rather odd: IEnumerable<CalendarViewEnum> _calendarViewEnums =...
Injecting a Dependency into an IHttpModule with Unity
We’re starting a new project, and as part of that we want to get better at certain things. One is unit testing the things we didn’t last time around that were...
IDisposable objects with StructureMap and ASP.NET MVC 4
I’ve recently discovered a bit of an issue with running an IoC container with ASP.NET MVC’s IDependencyResolver . If you have a controller that has...
Getting umbraco up and running in with MVC 4
In this post, I'll look at getting Umbraco and MVC to play nice with each other in the same project. Installing Umbraco 4.8 First off create a Web Application...
Tip of the day: Expire a cookie, don’t remove it
I recently found a bug in my code that I couldn’t fathom initially until I walked through the HTTP headers in firebug. In short, you cannot simply remove a...
Parallel Tasks and the HttpContext
A few days ago I spotted a question on StackOverflow by someone trying to use a parallel loop in an ASP.NET application. It may have been an ASP.NET MVC...
ASP.NET MVC – Pretty URLs
As the little Harris Benedict Calculator application stands , the only way to get some sort of answer out of it is to fill in the form. What if you wanted to...
ASP.NET MVC 3 – Introduction to validation
In my previous post on MVC 3 I started a project to calculate a calorific intake required to maintain a stable weight. In this post I’ll extent that to add...
ASP.NET MVC – Server Side Validation
So far, we’ve built up a basic application and got some client side validation working. However, client side validation only goes so far. While it can prevent...
Starting an ASP.NET MVC 3 application
In this post, I’m going to show the basics of starting an application with ASP.NET MVC 3. The demo application will be a simple calorie counter that takes in a...
Custom error pages and error handling in ASP.NET MVC 3
In ASP.NET MVC 3 a new bit of code appeared in the global.asax.cs file: public static void RegisterGlobalFilters(GlobalFilterCollection filters) {...
