JSON and XML View Engines in ASP.NET MVC

by Jon Davis 28. March 2008 18:28

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 ..."


kick it on DotNetKicks.com

Currently rated 1.5 by 21 people

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

Tags: , , , ,

Software Development | Web Development

Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

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 was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar