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 "/>