Use of Ajax. dll

Source: Internet
Author: User

 

Since there are a lot of Ajax code, I 'd rather write the code by myself. I saw an article in Hill yesterday, introducing the use of Ajax. dll.

Http://www.cnblogs.com/singlepine/archive/2005/10/19/257954.html

It is easy to use. As follows:

1. register your own handler class

Ajax. Utility. registertypeforajax (typeof (ajaxmethod ));
Here, your handler class is ajaxmethod. How to Write it can be played by the user

2. Use the method in ajaxmethod in C # code

This. dropdownlist1.datasource = ajaxmethod. getpovincelist ();
3. Use the method in ajaxmethod on the JS end

By using the temporarily generated ajaxtest. ajaxmethod and webapplication1.ashx (actually a Javascript file) functions, you can use the same function name on the JS end.

Ajaxmethod. getarealist (area. Value, get_area_result_callback );

Although the parameters are different, this is understandable.

In this way, the client applies and then passes
Getcitylist: function (povinceid, callback, context)
{Return New ajax_request (this. url + '? _ Method = getcitylist & _ session = R', 'povinceid = '+ ENC (povinceid), callback, context );},
Stimulate XMLHttpRequest. Then apply for ajaxtest. ajaxmethod, webapplication1.ashx from the server (how should I find this file ?), Finally, run the public dataset getcitylist (INT povinceid) command ).

Common. ashx in Ajax. dll and passing parameters through Jos can all be well learned. If you use reflector to understand this function, you can write a simple DLL to integrate the Ajax function.

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.