Ajax.net use of the early experience

Related Tags:

  AJAX contacts in the last year, but they are using manual methods to prepare the client code, with the requested pages, I feel very tired, although earlier heard AJAX.NET, and other third-party development of the framework , but has no time to experience.    Live today finished hands, under the latest version of the experience the next AJAX.NET 

  I use or VS2003, download the latest version of a AJAX.NET 6.4.5.1 Download Address: www.schwarz-interactive.de Below talk about the use of methods: 

  1, preparations for the new projects, use. NET1.1 downloaded on the use of the class AjaxPro.dll AJAX.NET, if it is used. NET2.0 cited AjaxPro2.dll 
  First revised document WEB.CONFIG 
  In "system.web> node increase 

<httpHandlers>
<addverb="*"path="*.ashx"type="AjaxPro.AjaxHandlerFactory,AjaxPro"/>
  </ HttpHandlers> 


  2, and then in the Page_Load event in the registration page category, as I will use AJAX pages category called 'AjaxControls' registration statement would be written like this: 

  AjaxPro.Utility.RegisterTypeForAjax (typeof (AjaxControls)); 

  The Scarlet Letter is the place I like the pages of 
  This is in fact the role of the requested pages generated when a few of the call JS code SCRIPT 

  3, prepared by the server-side processing function 
  Such as: 
  [AjaxPro.AjaxMethod] public string Fun (string str) (return str; 
  ) 

  '[AjaxPro.AjaxMethod]' This is the key, function or method of writing nothing special, only to the use of this function is this statement from AJAX.NET asynchronous request on the page, a word to remember access to data through AJAX Background on the use of the function [AjaxPro.AjaxMethod] to a statement. 
  In addition, if handled in AJAX.NET function SESSION need to operate, '[AjaxPro.AjaxMethod]' needs change '[AjaxPro.AjaxMethod (AjaxPro.HttpSessionStateRequirement.ReadWrite)]' [AjaxPro.AjaxMethod (AjaxPro.…… )] '……' ajax.net also provided some other way to deal with some special requests. 
  Another point that if the use of Application, Application directly read or write is because the need to use HttpContext.Current.Application also visit the Request also need to use HttpContext.Current.Request.    The reason is that the use of direct or Request Application Page category, and so on are inherited from, and background on the method used Ajax.net visit, these methods do not belong Page category.    However Session rather special, use HttpContext.Current.Session still can not visit, you must use the above section of the methodology used and the direct use Session on the trip. 

  4, the client code 
  In this example I used in 'Ajax.AjaxControls.Fun ( "test transmission parameters of the string");' request background function, and then return to a OBJECT object, and this attribute VALUE OBJECT on the background function can be return value 
  Such as: 
  Function doTest () 
  ( 
  Var getobject = Ajax.AjaxControls.Fun ( "test transmission parameters of the string"); 
  Alert (getobject.value); 
  ) 
  Ajax is my project Namespaces 
  I AjaxControls this page is the class name 
  Fun is a statement of the obvious is that AJAX can be called by the name 
  () Parameter is the Fun I needed to function parameters 
  DoTest () is a customer of the function, the control can be tied to the incident, could also have been no incidents, dealing with how casually 
  Asynchronous client requests received this function normally we use and the return of function is slightly different, usually directly from the function return value type, and the use of asynchronous client requests AJAX.NET background is a function to the OBJECT, through VALUE OBJECT of this attribute can be functions return values. 
  Customers usually here paragraph script can be written like this: 
  Function doTest () 
  ( 
  Ajax.AjaxControls.Fun ( "test transmission string parameters," getdata); 
  ) 
  Function getdata (rv) 
  ( 
  Alert (rv.value); 
  ) 

  Ajax.AjaxControls.Fun addition to the parameters in the corresponding function of the parameters of the background, the final parameters can use an expression, this parameter is a function of the customers were set up after a request by Ajax.AjaxControls.Fun target will be obtained OBJECT expression as a function of transmission parameters to the function, and then through this VALUE OBJECT parameters can be obtained by the AJAX request background function of the value of the return of 
  Through these steps can make a simple combination of the use of Ajax.net. NET sample page. 

  Below talk about the feelings after: 
  The overall impression is very easy to use, very simple, but not strong enough functions is perhaps the reason I first, but he did not explored the use of more advanced methods, but in the control of the server controls on the Basic realization of the need to use other Methods such as access control output format, and then adopted the method of loading client, and in addition to asynchronous requests for access to background function or method of the return value, the other more specific needs of complex operations are manually written code solution , but it is a good thing, can be very rapid completion of certain AJAX results.    Perhaps there are many more powerful features I have not yet Mosuodao I hope you will advise, added ~ 


Related articles:

To: AJAX Chinese lessons
  Recently wrote a ajax, testing has been no problem, the results into other computers, which have three to five computer display garbled, the enquiries about, there is a conclusion, very good! Ajax return to the original values are utf-8 decoder ,    AJAX Chinese issues fall into t...
SEO: ajax search engines killer?
  A few days ago to google with the open source projects GWT (Google Web Toolkit).    GWT is a very useful and very interesting things.    It is a concept: the use of pure jscript to create your website.    GWT example of a site Kitchen Sink, very complex pages, H...
OO to the CSS
  OO to the CSS: object-oriented style sheet Practice    Artists and programmers how cooperation?    My answer to this is to rely on the rules of CSS    Comparison of the structure because of the rules, so can be fixed to generate table Taglib    But ...
Application DreamWeaver web design skills CSS style sheets 2
  First, remove the hyperlinks underlined hyperlinks and achieve mouse hover Coloring:    In default, DreamWeaver used in the design of the website has underlined hyperlinks appear less attractive.    To remove these annoying underlined, many newspapers are on the way in t...
Site basic color - Allied
  In business, the colors are careful assessment, the general popular view, gray or black Series symbolic "occupation", because these color than non-individualism, a sense of moderation.    Gray is bright red or orange best background color.    These lively colors...