Recently I studied and sat a Microsoft Certification for ASP.Net 4.0 and MVC. As much as some people on the web cause grief to anyone who’s interested in certifications I must state that I actually did learn a lot about other parts of the framework that day-to-day I never touch. The great thing about this experience was that while yes I did learnt about some parts of the ASP.Net framework that I’ll never touch because in the real world you wouldn’t use them, I also found I learnt about a number of other parts of the framework that I didn’t know were there and these new bits of knowledge will help me daily.
One of the most common configurations people use when setting up ELMAH is email exception logging so that you get notified whenever “shit’s goin’ down” on your site. This leads to a follow on issue that stems from this in that you end up receiving 100’s of emails a couple of times a week as your website gets scanned by evil doers looking for vulnerabilities – but there is a simple and elegant solution.
ASP.Net’s [Authorize] attribute is another cool feature that makes it easy to add authentication at the Controller level when building a website, but the real goldmine here is that like nearly everything else in ASP.Net MVC, you can pick apart the functionality and extend it yourself – In this post we will take a look at creating our own custom Authentication attribute.
Anyone who asks me will know that i love the simplicity and elegance of creating ASP.Net MVC’s custom data annotations when writing your own validation in ASP.Net MVC. One situation that can be a tricky one to dig yourself out of when coming to more advanced validation logic is writing custom validation attributes that can see/compare properties between itself and other model properties.
While writing list navigation and search features in websites today there is a constant need to find/replace and play with query string elements, so that you can easily manipulate these mystical items while you’re carrying them around in your website’s URLs. I have a few little methods I’ve used over the years and carry with me project to project, and this post is putting them on the record for easy access later.
Having forms with checkboxes that require users to check them to be valid is a pretty common phenomenon on the internet today, however when thinking about this in terms of ASP.Net MVC it can not always be obvious what the best approach to take is. Thankfully the ASP.Net MVC team gave us the support to create a really simple solution when they added inheritable validation classes to the framework.
So It’s been about a year or so since I've written any Facebook applications for clients, and in that time quite a lot has changed in the space. There are quite a list of available libraries you can use to write Facebook applications in .Net with, so it can be sometime daunting to pick one as your favourite. This can be further complicated by the fact that for a lot of people, when they first go to write a Facebook application some of the jargon thrown around can be confusing when you know nothing about the Facebook API – what approach should you take? does having ASP.Net MVC or Silverlight support make the library a good one?