Ajaxpro troubleshooting guide

Source: Internet
Author: User
ArticleDirectory
    • Ajaxpro troubleshooting guide
Ajaxpro troubleshooting guide

Ajaxpro. dll has been used before, and it is very useful when the foreground calls the datatable in the background. The result is that the undefined error is always reported during use in the project yesterday. It's a headache.

I rummaged through the materials, but I still couldn't find a good cure for the problem. In the end, I had to use jquery to call the WebService method in the background.

However, record the important steps and error-prone parts of ajaxpro. dll. For instance usage, refer toAjaxpro.2.dll cascade drop-down box, provincial/municipal/CountyArticle 1.

1. Check whether ajaxpro. dll.2 references are added.

2. Check whether the node is added to system. Web in Web. config:

<Httphandlers>

<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/>

</Httphandlers>

3. Whether the namespace reference is added to the background. CS file.

Using ajaxpro;

4. Added page_load events

Ajaxpro. Utility. registertypeforajax (typeof (testajax); // testajax is the class name in the. CS file.

5. Whether the ajaxmethod is added before the method.

6. Foreground call:

Pay attention to the value to be taken after the method is returned. Because dataset is returned, it is best to first read data by performing non-null judgment.

7. The biggest headache is that ajaxpro is used in this project according to the daily steps, but all of them are prompted with an undefined error. I had to build an empty project and compare the problem. After testing, we found that:

The website contains sub-applications.ProgramFor example, the page in newfolder1 needs to use ajaxpro. The configuration mentioned in step 1 is mainly placed inOuter web. config.

Let's compare the results:

    • ① Add configuration text to the inner layer without adding the outer layer. An undefined error is returned. Testajax is the class name we used in the. CS file.

    • ② Add no configuration text to the inner layer, and add the outer layer. Displayed successfully.

8. In addition, there are some materials saying that the script part called by the front-end should be placed inside the form, and the form must be runat = "server ". But when I did the above test, it was okay to put the script in the head.

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.