Ajaxpro.2.dll usage and Solution to 64-bit server errors

Source: Internet
Author: User
Step 1: Add in webconfig
<Httphandlers>
<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/>
</Httphandlers>
Mainly, in <system. Web> </system. Web>
Second, reference ajaxpro.2.dll
Third, add a piece of code to the page. CS file that requires Ajax, and add [ajaxpro. ajaxmethod] before the method to be referenced by Js.
Example:
Protected void page_load (Object sender, eventargs E)
{
Ajaxpro. Utility. registertypeforajax (typeof (manage_businessmanadd ));
}
[Ajaxpro. ajaxmethod]
Public static dataset business_getall_group (string companycode)
{
Dataset DS = companycrm. dbasebs. executedatasetsql ("select companycode, groupcode from [companygroup] Where companycode = '" + companycode + "'");
Return Ds;
}
Fourth, directly call the method declared by [ajaxpro. ajaxmethod] On the CS page on the ASPX page.
<Script language = "JavaScript">
Function companyName ()
{
VaR Cn = Document. getelementbyid ("dropdowncompanyname"); // obtain a condition ID
Response = manage_businessmanadd.business_getall_group (CN. Value); // directly call the CS page
}
</SCRIPT> When a 64-bit server is deployed unavailable:Add the following configuration under the <configuration> node in Web. config <Location Path = "ajaxpro">
<System. webserver>
<Handlers>
<Add verb = "*" Path = "*. ashx" name = "ajaxpro" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/>
</Handlers>
</System. webserver>
</Location> Step 1: add
<Httphandlers>
<Add verb = "post, get" Path = "ajaxpro/*. ashx" type = "ajaxpro. ajaxhandlerfactory, ajaxpro.2"/>
</Httphandlers>
Mainly, in <system. Web> </system. Web>
Second, reference ajaxpro.2.dll
Third, add a piece of code to the page. CS file that requires Ajax, and add [ajaxpro. ajaxmethod] before the method to be referenced by Js.
Example:
Protected void page_load (Object sender, eventargs E)
{
Ajaxpro. Utility. registertypeforajax (typeof (manage_businessmanadd ));
}
[Ajaxpro. ajaxmethod]
Public static dataset business_getall_group (string companycode)
{
Dataset DS = companycrm. dbasebs. executedatasetsql ("select companycode, groupcode from [companygroup] Where companycode = '" + companycode + "'");
Return Ds;
}
Fourth, directly call the method declared by [ajaxpro. ajaxmethod] On the CS page on the ASPX page.
<Script language = "JavaScript">
Function companyName ()
{
VaR Cn = Document. getelementbyid ("dropdowncompanyname"); // obtain a condition ID
Response = manage_businessmanadd.business_getall_group (CN. Value); // directly call the CS page
}
</SCRIPT>

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.