Make preparations First: Copy ajaxcallobject. js to the script directory under the virtual directory (corresponding to this in the configuration information), add magicajax. DLL to the project (official site address is: http://www.magicajax.net /)
1. Add configuration information to Web. config.
< Magicajax
Outputcomparemode = "Hashcode"
Tracing = "False" scriptpath = "~ /Aspnet_client/magicajax" >
< Pagestore
Mode = "Nostore"
Unloadstoredpage = "False"
Cachetimeout = "5"
Maxconcurrentpages = "5"
Maxpageslimitalert = "False"
/>
</ Magicajax >
<Httpmodules>
<Add name = "magicajax" type = "magicajax. magicajaxmodule, magicajax"/>
</Httpmodules>
2. Use ajaxpannel to implement Ajax functions, which is similar to this in aspx:
<% @ Register tagprefix = "ajax" namespace = "magicajax. UI. Controls" assembly = "magicajax" %>
<Ajax: AjaxPanel id = "ajaxpanel1" runat = "server">
</Ajax: AjaxPanel>
3. Put the control that requires no refreshing into ajaxpannel.
4. Write delegate events for the dragged controls
5. magicajax uses ajaxcall for Refresh processing. This is similar to PostBack, but it is only applicable to controls in ajaxpannel and has a loading indication when calling the callpack. AvailableMagicajaxcontext. Current. isajaxcallDetermine whether it is an ajaxcall event (an event triggered by the client) or useMagicajaxcontext. Current. isajaxcallforpage(Triggered by transfer)
6. To solve Chinese garbled characters, recompileSource codeOpen the magicajaxmodule. CS file and you will see
Protected void application_beginrequest (Object sender, eventargs E)
{
Httpcontext context = (httpapplication) sender). context;
// Init private fields
_ Threadabortexceptionthrown = false;
_ Request = context. request;
_ Response = context. response;
_ Response. contentencoding=System. Text. encoding. getencoding ("Gb2312"); // Add this support for Chinese Characters
//...................................... ....................
7. Many static methods are provided through ajaxcallhelper, but there is no chance to use them.
8. When the browser does not support JS pages, no error or deformation will be reported. This is not bad.
9. I have not tried custom controls yet. I don't know if there will be any problems.