[Ajax] The simplest Ajax callback library ever

Source: Internet
Author: User
Most of the time, we only need to use some simple Ajax functions to provide some simple callbacks without fancy things. However, many of the existing Ajax libraries are very large. Although there are many functions, we don't need them at all in many cases. I have encountered such experiences, so I want to get a very simple Ajax callback function. First of all, I think of ajaxmanager in CS. I just want to simplify it and remove unnecessary and many methods that are more suitable for our habits.

I named him ajaxlite, because he only needs two classes to implement Ajax functions. In order to not include JS files separately, I embedded JS into the DLL. A total of two files, one JS, one CS file, and two classes. This is the simplest Ajax class library I have ever seen. You just need to reference the compiled DLL file to your project and then register your user control or page in the page_load event,CodeIt is also very simple.

1. Register: Find the method that contains the ajaxmethod attribute label in the current control and register it with the client;

2. Post: the method that contains the ajaxmethod attribute label in the client-returned type and callback function lookup control is executed and returned;

3. Render: register to the prerender in the page lifecycle, and then render and execute js to implement callback.

Source codeProject (vs2008 beta1): ajaxlite


Bytes -----------------------------------------------------------------------------------------



[2007-10-11]Fixed a bug: when there are multiple ajaxmethod annotation methods, a script error occurs (less than one !).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.