Originally, when I wrote Ajax in vs2003, I referenced Ajax. dll. Today I used vs2005 to find that this Ajax cannot be used. In the previous call dialog box, "jscript runtime error: the object is missing", so I found an ajaxpro.2.dll to reference it. All right, this problem is solved. But I don't know what other friends can do.
However, when using the background method in the foreground, do not forget to add the namespace and class name before the method. The callback method is last executed in the called method.
Pay attention to the front-end page encoding save, otherwise JS files will have problems Unicode (UTF-8 with signature)-code page 65001
<System. Web>
<Httphandlers>
<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/>
</Httphandlers>
Function jjj ()
{
Alert ("123 ");
Testajax. _ default. OOO (callback_method );
Testajax. _ default. AAA ();
// Alert (ooo ());
}
Function callback_method (V)
{
VaR result = V. value;
Alert (result );
}
Background
[Ajaxpro. ajaxmethod ()]
Public String OOO ()
{
String STR = "ooo ";
Return STR;
}
[Ajaxpro. ajaxmethod ()]
Public void AAA ()
{
String STR = "AAA ";
String str1 = "AAA ";
}