Using JSON in ASP.NET

ka_vol1_069 If you’ve been avoiding using JSON in your ASP.NET application because you think it’s hard, you’re an idiot. I can say that, because I’ve been avoiding it for exactly that reason. I’ve been an idiot too. But no more! Using an UpdatePanel is still easier than JSON. But JSON is easy enough that you may decide to use it over the UpdatePanel under certain circumstances.


The main problem with the UpdatePanel, as most know by now, is that all of the form data gets posted to the server and all of the server code runs during every update. While there are ways of detecting that the UpdatePanel is causing the postback and thereby limiting the amount of code that runs on the server, you are still left with a full submit of the client form elements to contend with. On a large form, and a form with a lot of view state information, this could be a huge consideration.


JSON, on the other hand, only sends the data that is needed for the WebService function it is calling and only returns the data that the WebService function returns. So you end up sending less data, executing less code on the server, and returning less code from the server. This can significantly increase the performance of your application as well as increase the scalability of your application.

However, it will take a lot more work to JSON-enable something like the GridView. In that case, you may decide that the cost of the development outweighs the performance gains of JSON and decide to stay with the UpdatePanel. There are places for both in your toolbox.


Other Related Items:

UEFA Champions of Europe: Champions League History 1955-2005UEFA Champions of Europe: Champions League History 1955-200550 Years of the Worlds Greatest Club Football. The best Goals from All 50 Finals. The list of champions is legendary- Real Madrid, Liverpool, A... Read More >
Lucinda's SpellLucinda's SpellThe magic scene sure has changed since Merlin's day. If writer-director Jon Jacobs's Lucinda's Spell is any gauge, modern spell casters are the equi... Read More >

Related Post

2 Responses to “Using JSON in ASP.NET”

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor