Tutorial :Most stable solution for doing AJAX with ASP.NET as a backend?



Question:

I'm planning a ASP.NET project for which I'm going to use AJAX. I'm researching all the available technologies for doing so in the .NET world. I need a solution that is well documented and stable. The current solutions I've found are: 1. ASP.NET AJAX UpdatePanel 2. ASP.NET AJAX with Web Services + JQuery 3. JQuery + Http Handlers

In the second and third solutions the backend would only send JSON or XML messages to the client.


Solution:1

In my experience the best way to go is JQuery with WCF with JSON webservices.

The reason is:

  1. ASP.NET ajax is gives you alot for free in terms of coding but is bloated from the start and needs to be stipted and slimed. On the other hand you have JQuery that you needs more development but is light weight. JQuery has a great plugin library as well.

  2. XML is to slow, JSON is fast.

Thats how I would do it today.


Solution:2

All will work but I've had most performance and stability with using JQuery and a script service.

An update panel will work but as its designed to work in the general case it can be a little bloated if you aren't careful. One reason being is that it posts the viewstate back with each update.

I recommend you check out the site: encosia.com as it has a number of posts on how to use script services and page methods. Then you can make a more informed decision. I would say that I've not used page methods and probably won't but that's entirely for personal reasons.

One other thing to consider will be any mvc you may end up doing. The general consensus is that it's a whole lot easier with JQuery. Added to that Microsoft have officially adopted it and also provide intellisense in VS2008.

All compelling reasons to include at least some of it in your project. In mine I only use the built in ScriptManager when I absolutely have to.

HTH!

S


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »