tags:

views:

886

answers:

4

hi, as you all know update panel send the same response to server as a full post back ( or maybe i am understanding wrong), it is true that it is much better than a full post back.

so is there an alternative to send only response data ? like you have a method that ill return date, i think this is the only thing that should be sent and not the whole control view state that is going to show it ( again maybe i understood it wrong).

i am using Telerik AJAX controls, and they are built upon Microsoft AJAX so there is not much of improvement there.

one approach i like is http://www.coolite.com/ they have AJAX Methods and events, which i think is what i am looking for, but the project is moving slowly and does not have flexibilities for my requirements.

so any input is highly appreciated.

+2  A: 

This is why I encourage programmers new to AJAX to learn the basics before adopting a library - when you understand what's actually happening, this sort of optimization becomes obvious.

so is there an alternative to send only response data? Like, you have a method that will return only a date?

Yes. The most basic way is to just write the date string to the response stream and end the response before anything else is sent - HTTP Handlers (ashx) work great for this. For a more ASP.NET AJAX-friendly technique, check out Web Methods.

Shog9
thanks a lot man for replying, i think web methods is great but what about Post back ?
If you want to go beyond data-heavy Update Panels to a more targeted, efficient technique, you'll have to actually pick the data you want to send by hand. Go read some basic XMLHttpRequest tutorials - it'll make a lot more sense once you understand what's going on underneath.
Shog9
+1  A: 

Rather than investigate controls I would suggest you investigate Ajax as a technology, and find out how it works. Having done this then look at the available implementations e.g. UpdatePanels, JQuery, etc

Conrad
+1  A: 

as you all know update panel send the same response to server as a full post back ( or maybe i am understanding wrong)

The main idea of the AJAX framework is to eliminate full-page postbacks. Only the relevant parts of the page are updated, without a disturbing refresh. The markup that is transferred between the client machine and the server is reduced dramatically, which results in a significant performance improvement for the user.

but if you looking for an alternative to page postback then I would recommend jQuery, but from the question it seems as if you're new to AJAX, so assuming you know javascript, hopefully you know that first to understand how jQuery works

TStamper
that is true what you say man, call me lazy or stupid but what keeps me in Update panel is no coding and hand writing of filling HTML by yourself through Jquery, i guess i have to pay for being lazy :)
+4  A: 

If you want more control, one technique is to use JQuery and AJAX Client Library for ADO.NET Data Services to bind JSON data on the client side.

Check this sample here. This is a good example of JQuery complementing ASP.Net AJAX.

First, I'm retrieving data from SQL Server and I need it in JSON format. I'm using the AJAX Client Library for ADO.NET Data Services to make a REST (GET) query to the back-end. To start with I'll just get the data...I include "datatable.js" as a client-side script and use Sys.Data.DataService() to make an async query. In JavaScript you can tell it's a Microsoft type if it's got "Sys." front of it. All the client support for ADO.NET Data Services is in datatable.js.

Gulzar