Ajax background call foreground Method

Source: Internet
Author: User

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 ";
}

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.