简体   繁体   中英

A pro alternative to microsoft AJAX Update panel?

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.

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.

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.

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 eg UpdatePanels, JQuery, etc

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM