Contents tagged with MVC

  • Custom XML model binder for ASP.NET MVC

    In an earlier post I wrote about using an XML value provider to allow you to send XML to your .NET MVC action methods. This is great, untill you want to accept XML where you have a model that needs XML atributes to control how it's deserialized. As the value provider stage happens before mondel binding it has no knowledge of the model objects that the values will be pushed into. So it can't look at your model class's XML attributes.

    In cases like this, you're better of using a custom XML model binder.

    To setup an XML model binder you need to create a model binder and a model binder provider. … more

  • Microsoft release more things than you can shake a stick at

    There are quite a few tools and products I’ve been eagerly awaiting from Microsoft. I’ve been working with beta versions and anxiously watching mailing lists for news of new features and possible release dates. I knew some of them would probably come out in January, but they went and released them all, and more this Thursday. It’s very exciting, but this simultaneous release is going to make it harder to learn about all of them.

    Orchard 1.0

    I’m most excited about this. I’ve been working with Orchard and writing some modules for it since their first alpha … more

  • Sending XML to an ASP.NET MVC Action Method Argument

    I read a great article recently by Phil Haack on sending JSON to an action method. This was very timely as I wanted to do exactly that in the REST API I've been created for a video hosting website. However, I wanted to make it work with XML as well as JSON.

    Phil Haack creates something called a JSON value provider, so I followed his example and created an XML value provider. I've used it on two projects now and it's worked a treat. I thought I'd share it with the world in the hope that it will be useful to others.

    Source code

    XML Value Provider (C# source)

    To get this working in your … more

  • Microsoft Webcamps

    Last weekend I went to Microsoft Webcamps London: a two day event mainly about ASP.NET MVC and a little bit about the Entity Framework. It was a two day event mainly aimed at Microsoft developers who'd not used .NET MVC before. I've done a few MVC projects now, but there's always more to learn and it's always good to meet other people doing similar stuff to you.

    The first day was a series of talks by Jon Galloway and Christian Wenz. The talks were excellent and even though they covered a lot of things I already knew, I still found out lots I didn't and made lots of notes.

    The second day was … more

  • 1