1. First add support in Web. config
<Httphandlers>
<Add verb = "post, get" Path = "ajax/*. ashx" type = "Ajax. pagehandlerfactory, Ajax"/> <! -- Ajax. dll -->
Or
<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/> <! -- Ajaxpro. dll -->
</Httphandlers>
2. Download Ajax. dll or ajaxpro. dll.
3. register classes with Ajax methods in the page class initial loading
For example, Ajax. Utility. registertypeforajax (typeof (ajaxclass); // ajaxclass is a self-written class.
[Ajax. ajaxmethod ()]
Public static string gettreestr ()
{< br> ilist parentnodes = new departmentservice (). getparentnode ();
string STR = "";
If (parentnodes! = NULL & parentnodes. count> 0)
{< br> for (INT I = 0; I {< br> STR + = "D. add ("+ (I + 1) +", 0, '"+ parentnodes [I]. name + "'," + "''); ");
}
}
Return STR;
}