asp.net + ajax--visual Studio 2008 trick

Source: Internet
Author: User

Finally gradually understand the essence of asp.net+ajax.
Its goal is to replace people handwriting JavaScript. On the one hand, it can simplify the writing of web pages, reduce the difficulty of implementing Ajax, on the other hand, encourage everyone to abandon JavaScript, which is a step against the Java camp, although JavaScript and Java have not much relationship. Without writing JavaScript, you can get an AJAX-like effect directly, making asp.net programmers excited. But the principle is still the principle of Ajax, change soup not dressing, the difficulty is reduced to the cost of loss performance.

Like many previous Microsoft tools, by adding some eclectic approach to occupy the market and beat opponents. For example, Visual J + + in the year, the biggest selling point is the speed of implementation, but secretly joined a lot of violations of the Java standard means, not cross-platform, not portable, quickly in the mainstream of the Java development platform to defeat the competition.
In order to fight by the Ajax expansion of the prestige of the Java camp, Ms so the play, will asp.net rendering some, reload battle. But this is just a product that has just formed, the propaganda significance is bigger than the application value.

With Asp.net+ajax, a large bundle of JScript Lib packages provided by the framework must be packaged to the client (Sourcejavascript.axd, and so on). A rough estimate of more than 400K, so the first time to open the page will be particularly slow.
It is this JScript Lib that implements the control of Ajax features such as ScriptManager and UpdatePanel. It takes over the commit event of the control within the UpdatePanel, is responsible for interacting with the server, and when returned, updates the control with the script in JScript Lib. In this way, JScript lib limits the refresh to the control and, in the view of the customer, does achieve the effect of a local update.
To disguise the delay in the communication process, JScript Lib provides updateprogress to stabilize the user.

The actual function of Jscript Lib is to manage the control and implement a page without a refresh operation. But this is only part of the Ajax, a small portion.
It masks the user's use of XML and JavaScript, thereby reducing the complexity of development. However, the control of the message is still a complete asp.net mode, that is, each operation, should be submitted to the server, operation processing, the results are uploaded to the client. It cuts down at least two very important features of Ajax.
The main feature of Ajax is to get the data asynchronously, and put this first in order to achieve faster response. When the user does not take the next step, Ajax has quietly downloaded the required data locally, so that it can respond more quickly to the user's next action. For example, to determine whether the "user name is registered", after the user fills out the user name, can be automatically initiated by JavaScript to the server request, the user fills in the following data process, the client can already know the user name is available.
An important significance of Ajax is the distribution of partial operations on the client side, thereby reducing server burden. The performer of this task is JavaScript. A lot of work that can be done locally, such as a simple "user name cannot be empty" judgment, is done directly locally, does not need to interact with the server, and does not need to wait for a response.

Asp.net+ajax only cosmetic, reduce page refresh, and the price must be loaded into the all-inclusive JScript library to slow down the page response. These functions can be achieved by simple javascript+xml and are more efficient and concise.
Here, we can almost assert that the Asp.net+ajax provided by Visual Studio 2008 is cynical Ajax. It can only meet the performance requirements are not high, good speed, and the pursuit of fresh vocabulary users. To develop real AJAX Web pages, you still can't get around JavaScript and XML.
</

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.