Tag Archives: C#

Displaying Validation Errors with ASP.NET MVC

We all know how important it is to validate user input, but it’s equally important how we present validation errors to the user. Take the following form: The email field needs to be optional but any address entered must be … Continue reading

Posted in Tips and Tricks | Tagged , , , | Leave a comment

Null Checking Made Easy

It’s fairly common for developers to need to move data from one class structure to another. If the class is complex you may find yourself writing endless null checks to ensure you don’t cause a NullReferenceException: This article includes a … Continue reading

Posted in Tips and Tricks | Tagged | Leave a comment

How to Deserialize Derived Objects in Json.NET

Imagine you need to process some JSON that looks like this: Notice how the array contains similar objects, two vehicles. Each vehicle has a “type” property that identifies the specific type of vehicle. If we wanted to deserialize this into … Continue reading

Posted in Reference | Tagged , | Leave a comment

ASP.NET MVC – Cannot create an instance of an interface

I came across an error message recently that I hadn’t seen before: The error occurred when I tried submitting the following form: The stack trace suggested it came from the model binder: [MissingMethodException: Cannot create an instance of an interface.] … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Wrapping JsonResults in ASP.NET MVC

Like a lot of web developers I like to load page content dynamically but this can cause problems if the Ajax request causes an error on the server. Timeouts can be handled in jQuery but what if the user needs … Continue reading

Posted in Reference, Tips and Tricks | Tagged , , , | Leave a comment

A Simple Ball Finding Algorithm

I’ve recently been playing with a Netduino and I’m considering connecting a camera to my Netduino powered Rover, with the aim of making it follow a ball. The trouble is the Netduino is very limited on RAM (60 KB), so … Continue reading

Posted in Projects | Tagged , | Leave a comment

Building a Netduino Rover – Part 5

See other posts in this series Fuzzy Logic In this post I’ll show you how to build an object avoidance behaviour using Fuzzy Logic. In contrast with traditional logic [Fuzzy Logic] can have varying values, where binary sets have two-valued … Continue reading

Posted in Projects | Tagged , , | Leave a comment