• Showing Enums in a dropdownlist on our ASP.NET MVC view

    A little while ago I posted a discussion on a method to decorate Enums with attributes to provide some flexibility with how they are displayed. Background This came about in a project I worked on where we wanted to show user friendly names of an enumeration on a Web UI page, but the same Enum was to be serialized to XML using a different set of names. Most articles concentrated on decorating an Enum with one attribute. We needed two, and wanted the ability to set which of those two took precedence in different scenarios. The code Here, I’m showing an implementation on how you could use that functionality to…

  • That stupid give way rule has finally gone

    Finally, New Zealand has woken up, bitten the bullet and changed the give way to right rule to what the rest of the world came to realise many years ago. After making the decision in parliament last year the rule changed this morning at 5am. For those unsure of what the rule change is, here’s a summary: If you come to a T junction and there is no Give way markings then remember “Give way to the top of the T“, or “Top of the T, give way to me“. Turning right into a street. Give way to all cars coming the other way whether they be turning or going…

  • Why as sportsman are we so thick and find it hard to adapt

    So we had our first rugby competition game yesterday and lost 14-11. The game itself was pretty uneventful. One try apiece a couple of penalties. However some things I found so frustrating was how hard it is for players to respond to what is being said. The game started as it meant to go on with a penalty conceded by our team after only about 2 minutes of play. After about 20mins of play we had not got out of our half and probably was on the end of a penalty count of about 10-4. About 3 times it was said by various members, including the captain, coaches and senior…

  • Posting content from memory stream using HttpWebRequest c#

    So I needed to upload a zipped file that I was creating in memory and send it to an MVC action on my server. I read plenty of examples and perhaps I could have gone down the route of saving the stream to a file on disk and then using the .net WebClient UploadFile method. But I didn’t and so I’ve ended up with a class based off a number of help from various parties including an excellent example at . A very good place to find the specification on what is needed is at . I found this helped alto and explained some of the missing pieces of information…