April 2010 Entries
First of, I would like to give a huge thanks to Phil Haack for his awesome blog post, Sending JSON to an ASP.NET MVC Action Method Argument, which shows how really flexible the ASP.NET MVC can be. Also, I owe him a beer next time I see him for saving my behind and providing an actual solution to my original POSTing JSON Data to MVC Controllers post.
Client-side JSON ‘Serialization’
In Phil’s post, he mentions that using a model binder falls short because of the lack of validation support:
There’s one key problem with using a model binder to accept JSON....
I’m sure that some (if not many) of you know this little approach for posting data from a JSON POST action (through jQuery) to an MSMVC Controller. If you don’t, keep reading otherwise go read something more important :)
As Phil noted, what the title should read is Receiving JSON Data from An Action Method, so my apologies for being misleading on the title. To see how you can actually post JSON data, check out Phil's Sending JSON to an ASP.NET MVC Action Method Argument post.
What are you trying to do?
While working on MSMVC sites, I (like many of you) find...
Great minds think alike … or is it that fools seldom differ? I forget… In any note, all I can say that in this case it took three people’s work to make this possible in order to bring simplicity to the masses. Please note that this piece is a work in progress and we’re still trying to figure out how things will be at the end for these two frameworks to interact. Also, if you want more code, I suggest you check out the Fubu sample for MVC Turbine. What does it all mean, Basil? I’m not going...