JSON and XML View Engines in ASP.NET MVC

by Jon 3/28/2008 6:28:00 PM

I posted earlier that we're working on a client-side MVC framwork that compliments the ASP.NET MVC framework. It's actually not formally MVC on the client, but it comes close. The view side is entirely controller-driven, even the event model. The "model" side of it is the ASP.NET server itself. So the server spits out both templated markup for the client-side controls, as well as the AJAX'd data models. These data models are models to the client but they are views to the server, or at least that's the way we're designing it.

So my co-worker posted his solution to XML and JSON callbacks, since ASMX is not MVC-friendly. It's a JSON view engine for MVC.

"I recently saw Scott Guthrie at a local .NET User Group event, and he mentioned that the ASP.NET MVC Framework was completely "pluggable", and you could easily replace the built-in View Engine.  So, I immediately searched for examples, found one ... tossed it out and whipped together a really quick and simple 'JsonViewEngine' class. Here's the code ..."

http://www.fragmentedcode.com/2008/03/27/jsonviewengine-for-aspnet-mvc-framework/

kick it on DotNetKicks.com

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Software Development | Web Development

Related posts

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

11/21/2008 3:31:34 AM


 

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Jon Davis Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."
 
Jon is currently in a temp-to-perm contract with a media corporation that primarily produces B2B magazines. The insanely complete and powerful Content Management System that they are switching to is SiteCore CMS, which is arguably the richest and most complete ASP.NET 3.5 based CMS on the planet.
E-mail me Send mail

Most Recent of Many Library Investments

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
346789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in