Ajaxpro.2.dll usage and Solution to 64-bit server errors
Last Update:2018-12-03
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>