What Is Ajax? C# Help

Ajax enables you to enhance the user interfaces of Web applications by means of asynchronous postbacks and dynamic client-side Web page manipulation. The term Ajax was invented by Jesse James Garrett and is shorthand’ for” Asynchronous JavaScript and XML.”

Note that Ajax is not an acronym, which is why it is not capitalized as AJAX. However, it is capitalized
in the product name ASP.NET AJAX, which is Microsoft’s implementation of Ajax, as you will see in
the next section.

By definition, Ajax involves both JavaScript and XML. However, the Ajax programming requires the use of other technologies as well, which are described in the following table.

Technology                  Description

HTML/XHTML: HTML (Hypertext Markup Language) is the presentation and layout language used by Web browsers to render information in a graphical user interface. In the previous two chapters, you have seen how HTML achieves this functionality and how ASP.NET generates HTML code. Extensible HTML (XHTML) is a stricter definition of HTML that uses XML structure.

CSS: CSS (cascading style sheets) is a means by which HTML elements can be styled according to rules defined in a separate style sheet. This enables you to apply styles simultaneously to multiple HTML elements and to swap styles to change the way a Web page looks without HTML modifications. CSS includes both layout and style information, so you can also use CSS to position HTML elements on a page. You have seen how to do this in the examples.

DOM: The DOM (Document Object Model) is a means of representing and manipulating (X)HTML code in a hierarchical structure. This enables you to access, for example, “the second column of the third row in table x” in a Web page, rather than having to locate this element using more primitive text processing.

JavaScript: JavaScript is a client-side scripting technology that enables you to execute code inside a Web browser. The syntax of JavaScript is similar to other C-based languages, includingCs, and provides variables, functions, branching code, looping statements, event handlers, and other familiar programming elements. However, unlike C#, JavaScript is not strongly typed, and debugging JavaScript code can be notoriously difficult. In terms of Ajax programming, JavaScript is a key technology because it allows dynamic modifications to Web pages by way  DOM manipulation – among other functionality.

XML: XML, as you hAveseen throughout this book, is a platform-neutral way to mark up data and is crucial to Ajax both as a way to manipulate data and as a language for communication between the client and the server.

XMLHttpRequest: Since Internet Explorer 5, browsers have supported the XMLHttPRequest API as a means of performing asynchronous ‘communication between the client and server. This was originally introduced by Microsoft as a technology to access email stored in an Exchange server ‘over the Internet, in a product known as Outlook Web Access. Since then, it has become the standard way to perform asynchronous communications in Web applications, and is a core technology of Ajax-enabled Web applications. Microsoft’s implementation of this API is known as XML which communicates over what is often called the XMUITfP protocol.

Ajax also requires server-side code to handle partial-page postbacks as well as full-page postbacks. This can include both event handlers for server-control events and Web services. Figure 39-1 shows how these technologies fit together in the Ajax Webbrowser model, in contrast to the “traditional” Web browser model.

Prior to Ajax, the first four technologies listed in the preceding table (HTML, CSS, the OOM, and JavaScript) were used to create what was known as Dynamic HTML (DHTML) Web applications. These applications were notable for two reasons: they provided a much better user interface, and they
generally worked on only one type of Web browser.

Figure 39-1

Figure 39-1

Since DHlML, standards have improved, along with the level of adherence to standards in Web browsers. However, there are still differences, and an Ajax solUtion must take these differences into account. This has meant that most developers have been quite slow to implement Ajax solutions. Only
with the advent of more abstracted Ajax frameworks (such as ASP.NET AJAX) has Ajax-enabled Web site creation really become a viable option for enterprise-level development.

Posted on November 2, 2015 in ASP.NET AJAX

Share the Story

Back to Top