Step 1: first reference AjaxPro.2.dll Step 2. add the following lines in config: system. webhttpHandlersaddpathajaxpro *. ashxverbPOST, GETtypeAjaxPro. ajaxHandlerFactory, AjaxPro.2httpHandlerssystem. web note: in some cases, you may need to add the following lines.
Step 1: first reference AjaxPro.2.dll Step 2. add the following lines in config: system. web httpHandlers add path = ajaxpro /*. ashx verb = POST, GET type = AjaxPro. ajaxHandlerFactory, AjaxPro.2 // httpHandlers/system. web note: in some cases, you may need to add the following lines.
Step 1: first reference AjaxPro.2.dll
Step 2: Add the following lines in web. config:
Note: In some cases, the following rows may be added. Note that the locations are different from those added to the uplink:
Step 3: Add the following (example A) to the public partial class in the cs file ):
[AjaxPro. AjaxNamespace ("AppAjax")]
// After adding this row, you only need to "AppAjax. Method Name" to call the method in aspx"
// Ignore this step. If this line is not added, the method called in aspx is the value of Inherits on the page, that is, "Inherits value. method name"
Step 4: Add the following line to the Page_Load class (Example ):
AjaxPro. Utility. RegisterTypeForAjax (this. GetType ());
Step 5: Add [AjaxPro. AjaxMethod] (example A) to the upstream of the public class to be called)
Example:
Using System;
Namespace WebApplication2
{
[AjaxPro. AjaxNamespace ("AppAjax")]
Public partial class _ Default: System. Web. UI. Page
{
Protected void Page_Load (object sender, EventArgs e)
{
AjaxPro. Utility. RegisterTypeForAjax (this. GetType ());
}
[AjaxPro. AjaxMethod]
Public string s (string)
{
Return a + "s ";
}
}
}
Example of using AjaxPro in aspx:
<% @ Page Title = "Homepage" Language = "C #" MasterPageFile = "~ /Site. master"
CodeBehind = "Default. aspx. cs" Inherits = "WebApplication2. _ Default" %>