When Ajax. dll is used, the script error "ajaxmethod undefined" is thrown"

Source: Internet
Author: User

There is no problem on the test server (Operating System 2003 + IIS6), and there is a script error in the formal environment (windows2008 + iis7.0)

The key lies in the problem of IIS.

Note the following:

(1) Register ajaxmethod:

Protected void page_load (Object sender, system. eventargs E)
{
// Place user code here to initialize the page
Ajax. Utility. registertypeforajax (typeof (airticketmanager. ajaxmethod ));

} // If this sentence is not registered, it will also cause a question error.

(2) Configure in webconfig (forgot to manually configure or reference the configuration)

<System. Web>

<Httpmodules>

<Add verb = "post, get" Path = "ajax/*. ashx" type = "Ajax. pagehandlerfactory, Ajax"/>

</Httpmodules>

</System. Web>

<System. webserver>

The above configuration is as follows in iis6.0. If this sentence is missing, a script error such as the question will also be thrown.

(3) IIS version Problems

If none of the above problems exists, make sure that AJAX. dll also exists, but still prompts "ajaxmethod undefined", you must consider the IIS version.

Iis7 needs to add the sentence in webconfig to system. webserver.

<System. webserver>

<Add name = "ajaxmethod" type = "Ajax. pagehandlerfactory, Ajax "verb =" post, get "Path =" ajax /*. ashx "/>

 

 

 

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.