Ajax.NET key

Ajax.NET key
1, configuration
-dll references to bin
· Ajax factory to the Web.config cut HTTP
   <httpHandlers>
    <the Add verb = "POST, GET" path = "AjaxPro / *. Ashx" of the type = "AjaxPro.AjaxHandlerFactory, AjaxPro .2 "/>
   </ the httpHandlers>
· Register runtime:
            AjaxPro.Utility.RegisterTypeForAjax (typeof (AH.Factrory));
            AjaxPro.Utility.RegisterTypeForAjax (typeof (the _Default));
current or other ns ns Jieke
2, the server procedure:
using labeled, random parameter
        [AjaxPro.AjaxMethod]
        public String GetServerTime (PAR String, String UI)
        {
            String = DateTime.Now.ToString STR ();
               System.Threading.Thread.Sleep (2220.);
            return PAR + STR + DateTime.Now.ToString () + ui;
        }

3, client-side script
       function getServerTime_callback (RES)
       {
          $ ( "the display") = res.value the innerHTML + + "a";.
       }
      
       Function DOD () {
           AH.Factrory.GetServerTime ( "| + |", " ******* \ 9 Chinese 774r ", getServerTime_callback); 
     
       }
from js ns as a direct object reference layers down until the calling method.
The third parameter is an asynchronous callback function. Synchronous method call return value is the value returned by the server.
4, at the cattle quod
Multi-threaded, many powerful than MagcAjax. It allows clients to simultaneously run a lot of asynchronous thread, go hand in hand. Synchronous Asynchronous easy to distinguish.
Multi-parameter passing flexible, easy to use it more than ICall client script references server objects directly from ns, with up very cool.
· Background to the type of compatible scripting environment, a reference example, cross-compatible with 17 kinds of Taiwan before and after the data type.
· FF compatible (but not compatible with Opera)

Attachment: four members of res asynchronous callback parameter
error
value
Request
context


Demo
http://files.cnblogs.com/civ3/Async.rar
Ref
http://zhuweisky.cnblogs.com/archive/2006/04/19/378870 .html
http://gujianxin.cnblogs.com/archive/2006/04/19/379182.html
More:
http://weblogs.asp.net/mschwarz/archive/2006/04/03/441767.aspx

Reproduced in: https: //www.cnblogs.com/civ3/archive/2006/04/22/382385.html

Guess you like

Origin blog.csdn.net/weixin_34411563/article/details/93571481