Tuesday, February 3, 2009

Tip #2 - JSON and MVC goes hand in hand

As I needed to use some json for an ASP.NET MVC application, I looked at and old sandbox project, that used som EXTJS json implementation. But along come a good frien of mine, mr. google :)
I asked him about "jquery json" and he told me this.
How simple can it be, just another kick into the great place of ASP.NET MVCand JQUERY.
In short terms you simple uses JsonResult instead of the default ActionResult, which is part of System.Web.Mvc. As return of the controller action you call return Json(yourdata).
Simple, great, just what I needed to know and didn't find else where.

No comments: