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.