--------Microsoft Ajax Solutions (*)--------
Asp. NET built-in controls for simplifying Ajax development UpdatePanel
Put ScriptManager, the controls that will implement the Ajax effect into the UpdatePanel
UpdatePanel principle exploration, with HttpWatch
Only the parts that need no refresh updates are placed in the UpdatePanel
UpdatePanel is used to achieve some of the requirements of low performance requirements are very convenient
Timer to implement the timing Ajax effect, interval set the time interval, put in UpdatePanel inside
UpdateProgress "Loading Data" is displayed
Introduction to AJAX Toolkit
--------WCF simplifies Ajax (*)---------
Development steps:
Add a Web project, create new item in Web project → web → "ajax Enabled
WCF Service (2008 in the "C #" root category) page, drag and drop the ScriptManager control, ScriptManager's services genus
Added, the Path property is set to the service path, such as "~/service1.svc" when invoking the service-side method
Service1.dowork (ondoworksucceed,ondoworkfailed), Service1 is the service class name, DoWork is the method name,
Ondoworksucceed is the function that is called back when the call succeeds (the delegate in JavaScript), ondoworkfailed is the call failure
The function that is called when the callback occurs. Two functions have one parameter result, the result value of the successful function is the function return value, the failure letter
The result value of the number is an error message. The call is asynchronous. Note that this is the JavaScript code!
Note "~service1.svc" is added to the ScriptManager's Services property, not the scripts attribute. If you write JavaScript
Do not automatically prompt, turn off the ASPX and then open the line. If it doesn't work, write it manually.
The server can also return complex objects, and the JS side can read the field values of complex objects directly from result.
Microsoft Ajax Solutions