Ajax| Strategy | Technology platform 2. Anthem.net
Now it's version 1.0, the idea is to follow the idea that, since ASP.net's standard controls do not implement the Submit function, I can generate a committed interface, then inherit the original standard control, and then implement the interface so that each control can be submitted separately to the server side.
The occurrence of each control is similar to magicajax.net,anthem.net provides a submit function for each control's JavaScript side-which is equivalent to intercepting the __dopostback, after anthem.net It also provides sophisticated client-side events such as Postcallback and Precallback, and then uses XMLHttpRequest to simulate a traditional page submission request to the server, server-side generation of page instances, This process is the same as magicajax.net, and finally, the rendered HTML is passed back to the client in the control's render () event, and the innerHTML of the client control is assigned and dynamically updated.
Unlike Magicajax.net, Anthem.net does not have the concept of a container, because each control adds a submit interface, so it can be submitted separately, so the unit is committed in one control unit, and the anthem.net is less expensive (but the server side is similar, Because the entire ASP.net page pipeline will be carried out).
In addition, Anthem.net has another function, that is, the client can invoke the method in the page and get the results/data, in which case, you will call the Anthem_invokepagemethod method, not the anthem.net provided by the default individual control submission method. The result.value in this JavaScript callback handler will be able to get the execution result of a method of the invoked server (the method is marked with [Anthem.method]) because the javascriptpost data has page/ Masterpage/control, it is easy for the server side to get the address of the method through this identification, apply reflection to find the [Anthem.method] tag, and then call to return the result to the client.
Anthem.net supports return objects, dataset,datatable and Writedatarow (Writedataset,writedatatable,writedatarow,writeobject), Returns a string that conforms to the JSON specification, so that the client's JavaScript can use these objects. Unlike Magicajax.net,anthem.net, which does not use HTTP Model, the result is to process and return the result of the request in the PreRender () event of the page.
2.1 Ajax.NET Professional
I have not seen the source code for Ajax.NET Professional, but I see from the example that it supports a method of calling the page, and the return object, the dataset,datatable data, I think Ajax.NET Professional The implementation and anthem.net principle is the same, although Ajax.NET Professional uses the HTTP Model, this is just like anthem.net, the final processing results of the return processing slightly different. In comparison, Ajax.NET Professional does not inherit all of the commonly used ASP.net controls to implement partial-commit functionality, so it is possible that ajax.net Professional is more powerful than the call to a method on the page and the data on the client to obtain results. This is enough to achieve most of the AJAX functionality.
At this level, I think ajax.net Professional is relatively unwieldy and complex. Anthem.net does not use HTTP Model, provides basic local commits for controls, and also provides client-side method calls at the data level. Ajax.NET Professional's source code doesn't always seem to be shared, which is another reason why I don't like it.
In any case, no one offers a two-way data exchange, where the client can obtain the server-side method and obtain the results and data, but currently supports the modification of these objects/data to the server side.
Anthem.net some of the deficiencies and ideas:
1) Anthem.net is also a "Hook asp.net" principle, designed to make up for asp.net of the entire page of the submission and postback, and in the client's data access and interaction has been strengthened.
2) Anthem.net need to asp.net the controls provided by inheritance and packaging, so use and functional compatibility is very sensitive.
3 Perhaps Microsoft's next version of ASP.net's standard controls can draw on the anthem.net approach, adding the remote callback interface to each control.
4 The current version of the function has been very powerful and slightly more complex, and deployment is more convenient, no need to set the HTTP Model.
3. Wwhoverpanel AJAX control for ASP.net
Wwhoverpanel AJAX controls for ASP.net This is also a ASP.net control, but provides a client callback (advanced callback), a client-side call page method, and a bidirectional two-way serialization feature.
Wwhoverpanel absorbs the benefits of magicajax.net and anthem.net and combines the ASP.net client callback feature as a lightweight Ajax component.
One of the two biggest features of Wwhoverpanel is the simple way to implement a Hoverpanel Behavior, which is simpler than the Behavior of the present Atalas, author Rick Strahl It is also emphasized that this is mainly a combination of his specific applications, such as the provision of a small HTML board, you can display the results obtained information.
Wwhoverpanel also provides a method of local callback, but this implementation and magicajax.net as well as Anthem.net is completely different, it is using a startcallback JavaScript to combine query string submissions and use XMLHTTP to send requests to a page of the server (specified by the ServerURL attribute), The page then returns the result with the native HTML content of Response.Write (). This is very similar to the ASP.net callback method, and it also supports sending requests to asp.net outside this page and obtains results, so it enhances the original ASP.net client callback method, which supports other page callbacks. It can be said that this is a URL based client callback.
The second feature provided by Wwhoverpanel is that the client can invoke a method of a page in the server-side (these methods are identified by [Callbackmethod]), in which case you will set the Eventhandlermode= " Callpagemethod, and then use the Wwhoverpanel. Server method Name (parameters, parameters, ..., callback handler functions) to invoke. This actually uses a JavaScript Callmethod method that invokes the server-side request. Javascript's handlecallback is used to handle the returned results, the logic is relatively simple, although the control of the innerHTML is also assigned, but this is mainly to maintain as the client callback results displayed in the small HTML Board content, otherwise it is called the method in the page, Then the result is directly to the client's callback method.
Feature three, is I said the two-way serialization function, in fact, this scene we also very need, for example, we use a client callback or XMLHTTP request to obtain an order object, then the client modified, I also want to call it as a client input parameters, return to the server side. The two-way serialization is needed, because this time the server needs to serialize the data from the JavaScript function to a. NET class. This is the bidirectional serialization of JSON (the main code is JSONSerializer.cs), which is one of my favorite features because I've been focusing on this feature for a long time, but the current ajax-net framework doesn't support this feature.
Now in the Wwhoverpanel scenario, I think this is a lightweight implementation that needs to be optimized on both the client and server side for multi-tier nested multiple-referenced object graph types or large capacity access pressures, so if it's an AJAX architecture, Client and server-side communication and delivery of data on the communication layer, is obviously somewhat thin.
Wwhoverpanel some of the deficiencies and ideas:
1 The control is currently I have seen. NET platform, the only AJAX control that supports both client-side callbacks and page-method calls, while supporting two-way serialization.
2 In contrast, Wwhoverpanel is the simplest design, and is based on controls that do not rely on HTTP model and asp.net Page Pipeline, and do not rely on ViewState
3 The control enables you to strike a balance between the customer callback and the client invocation page method at the technical level of the Ajax feature implementation.
4 The current client callback supports other page callbacks, but the resulting output needs to output raw HTML, which affects the layering and design of the application.
5 JSON bidirectional serialization is a good solution, but in a high-performance scenario, you should consider implementing a more efficient serialization framework
4. Atlas
This product, I will not enumerate the specific features, but mainly to say my views on its and the attitude of holding. Because I mentioned the problem in my Ajax book review.
Atlas is a personalized product, its advantages are obvious, the shortcomings are obvious, but first you must realize that it is a more complex, with a higher learning curve solution. For its complexity, to be honest, most people lack real feelings at the moment.
The most recent version of the-jan CTP, we see some features, and its strength is:
1. Client (Javascript) data binding, calibration to facilitate.
2. The new update panels not only has the Magicajax.net feature, but also is more powerful and is the primary control for asynchronous callbacks in Atlas.
3. Controls with specific AJAX features built into it, such as Autocompleteextender, Dragoverlayextender
4. Some of the controls are available, such as ScriptManager, triggers, Timercontrol
5. The main purpose is to provide a solution for integrating the characteristics of a client control and server-side controls and easy to use development efficiency.
But the disadvantages are obvious, for example:
1. The behaviors of the client is still weak, and the template (templates) and UI enhancements (UI enhancements) features have not been seen.
2. The so-called Client Atlas control ("Atlas", client Controls) and the server-side Atlas control ("Atlas" server Controls) do not yet have a clear specification, so you are basically unable to create a custom Atlas control ( Either the client or the server side.
3. Only services that invoke Web services are currently supported, not seen for ASP.net built-in services and WCF service support, nor do they support method calls within pages or controls
4. function is not stable, some features only under the specific conditions of the implementation of the characteristics, can not meet the requirements of the deployment of production environment. I think that if Atlas publishes Go-live License, then you can consider putting atlas into a formal project or application.
I do not recommend that you apply it to an older ASP.net project right now, or that older projects migrate to ASP.net v2.0, and more often, if you are creating a new ASP.net application that spans its learning curve, consider using it. The present situation, for Atlas, I recommend that you stay focused and practical, but inhibit your interest in applying to projects; Because Ajax, you can now start to focus on and learn about it, but you can't just choose Atlas for the Ajax feature, Then there can be risks.
Note: The Atals Microsoft.Web.Script.Serialization namespace has Javascriptobjectdeserializer and Javascriptobjectserializer two objects, the first , I'm not sure if it's also JSON serialization, and I'm not sure if it supports two-way serialization at the moment, and second, I can't customize or extend the current version, and it's hard to make any conclusions about its performance.
- Ajax: A new way to build Web apps
- Discussion on the error handling mechanism of AJAX (2)
- Discussion on the error handling mechanism of AJAX (1)
- First experience. NET Ajax Brushless New technology
- A brief analysis of Ajax development Technology in Rails system (4)