First, a brief introduction
Ajax (asynchronous JavaScript + XML) applications can send and retrieve only the necessary data to the server, using SOAP or some other xml-based Web service interface, and using JavaScript on the client to handle the response from the server. Because the amount of data exchanged between the server and the browser is much reduced, the result is that we can see applications that respond faster. At the same time, a lot of processing work can be done on the requesting client machine, so the Web server has less processing time.
The advantage of AJAX applications is that:
1. Improved user experience through asynchronous mode
2. Optimizes the transmission between the browser and the server, reduces the unnecessary data round-trip, reduces the bandwidth occupation
3. The Ajax engine runs on the client, taking on a portion of the work that was originally undertaken by the server, thereby reducing the server load under large user capacity.
Second, the configuration
Ajax.NET has AjaxPro.dll and Ajax.dll two versions, these two versions use although similar, but there is a difference, the main difference in the following two points:
(1) Web.config configuration file is not the same
The Ajax.dll configuration file is written as
<add verb= "Post,get" path= "Ajax/*.ashx" type= "Ajax.pagehandlerfactory, Ajax"/>
The AjaxPro.dll configuration file is written as
<add verb= "*" path= "ajaxpro/*.ashx" type= "ajaxpro.ajaxhandlerfactory, Ajaxpro"/>
(2) Call the server method when the way is different, there are many friends for this reason, found that the namespace is not found or the object is not defined
When referencing Ajax.dll, the call server method does not add namespaces.
When applying AjaxPro.dll, calling the server method requires a namespace
For example, when the page is set to this setting
<%@ Page language= "C #" codebehind= "Test.aspx.cs" autoeventwireup= "false" inherits= "Web.test"%>
(3) How the client calls
Ajax.dll for
var response=Test.GetServerMethod();
alert(response.value);
AjaxPro.dll for
var response=Web.Test.GetServerMethod();
alert(response.value);