ASP. net ajax Overview

Source: Internet
Author: User
Tags object serialization

 

Using the AJAX function in ASP. NET, you can quickly create a webpage containing responsive and familiar User Interface (UI) elements to provide a rich user experience. AJAX functions include client script libraries that combine cross-browser ECMAScript (JavaScript) and dynamic HTML (DHTML) technologies, and are integrated with ASP-based.. NET Server development platform integration. By using AJAX, you can improve user experience and improve the efficiency of Web applications.

Why ASP. net ajax?

You can use the AJAX function in ASP. NET to generate a wide range of Web applications. These applications have many advantages over server-based Web applications. Applications supporting AJAX can provide:

  • Enhanced efficiency, because most of the processing work on the web page is performed in the browser.

  • Familiar UI elements, such as progress indicators, tooltip, and pop-up windows.

  • Partial page update. Only the modified webpages are refreshed.

  • The client is integrated with ASP. NET application services, roles, and user configuration files for Forms authentication.

  • The automatically generated proxy class simplifies the process of calling Web service methods from client scripts.

  • A framework that allows you to customize server controls to include client functions.

  • Support for most popular and commonly used browsers, including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari.

Structure of AJAX functions in ASP. NET

The AJAX function structure in ASP. NET consists of two parts: client script library and server component. These two components are integrated to provide a reliable development framework.

Note:

In addition to the AJAX functions in ASP. NET, you can also use the ASP. net ajax control toolbox and functions in future Microsoft ASP. NET versions, all of which are supported by the community.

Displays the functions contained in the client script library and server components.

ASP. net ajax client and server structure

This figure shows the client-based Microsoft AJAX Library functions, including support for creating client components, browser compatibility, and networking and core services. It also displays server-based AJAX features, including script support, Web services, application services, and server controls. The following sections describe the graph in more detail.

AJAX client structure

The client structure includes libraries for component support, browser compatibility, network, and core services.

Components

Client components enable rich behaviors on the server without sending back. These components are divided into three categories:

  • Components, which are non-visual objects (such as timer objects) that encapsulate code ).

  • Behavior, which can expand the basic behavior of existing DOM elements.

  • Controls. These controls represent new DOM elements with custom rows.

The type of the component used depends on the type of client behavior. For example, you can create a watermark for the text box by appending it to an existing text box. For more information, see create client components and controls.

Browser compatibility

The browser compatibility layer provides AJAX script compatibility for the most common browsers, including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari. This allows you to write the same script for various supported servers. For more information, see browser security settings on ASP. NET pages that support AJAX.

Network

The network layer processes the communication between scripts in the browser and Web-based services and applications, and manages asynchronous remote method calls. In many common scenarios (such as using Controls), the network layer is automatically used without writing any code.

The network layer also provides support for accessing server-based Forms authentication, role information, and configuration file information in client scripts. As long as the application has access to the Microsoft AJAX Library, this support is also available in Web applications not created using ASP. NET. For more information, see Web Services in ASP. net ajax.

Core Services

The AJAX client script library in ASP. NET is composed of JavaScript (. js) files that provide functions for object-oriented development. The object-oriented functions included in the ASP. net ajax client script library enable high-level consistency and modularity in client scripts. The following core services are part of the client structure:

  • Object-oriented extensions for JavaScript, such as classes, namespaces, event handlers, inheritance, data types, and Object serialization.

  • A base class library that contains the string generator and extended error handling components.

  • Support for JavaScript libraries, which will be embedded in the assembly or provided as a separate JavaScript (. js) file. Embedding a JavaScript library in a set of programs makes it easier to deploy applications and helps solve version problems.

  • For more information, see use Microsoft AJAX Library to create custom client scripts.

Debugging and error handling

Core Services include Class to display objects in readable form at the end of a Web page. This class also displays tracing messages that enable you to assert and interrupt to start the debugger. An extended The object API provides useful exception details and supports release and debugging modes. For more information, see overview of debugging and tracking AJAX applications.

Globalization

The AJAX server and client structure in ASP. NET provides a model for localized and global client scripts. This allows you to design applications that provide UI for multiple region settings (Language and Culture) using a single code library. For example, the AJAX structure enables JavaScript code to automatically setDateOrNumberYou do not need to send the object back to the server. For more information, see Walkthrough: client script globalization date

AJAX Server Structure

The server module that supports AJAX development is composed of ASP. NET Web server controls and components that manage the application UI and stream. These server modules also manage serialization, verification, and control scalability. There are also some ASP. NET Web services that allow you to access ASP. NET application services for Forms authentication, roles, and user configuration files.

Script support

The AJAX function in ASP. NET can be implemented by using a script sent from the server to the client. Based on the AJAX function enabled, different scripts are sent to the browser.

You can also create custom client scripts for ASP. NET applications. In this case, you can also use AJAX to manage custom scripts that are used as static. js files (on disks) or as resources embedded into. js files in the Assembly.

The ASP. net ajax function includes a model for publishing and debugging modes. The release mode provides error check and exception handling, optimizes performance, and uses a minimum number of scripts. The debugging mode provides more reliable debugging functions, such as type and parameter checks. When the application is in debug mode, ASP. NET runs the debug version. This allows you to raise an exception in the debugging script and keep the minimum number of released code.

The support for AJAX scripts in ASP. NET can be used to provide two important functions:

  • Microsoft AJAX Library, a type system and a set of JavaScript extensions that provide namespace, inheritance, interfaces, enumeration, reflection, and other functions. For more information, see .

  • Partial pagination. This function can be used to update the page area by sending an asynchronous response. For more information, see overview of partial page rendering.

Localization

The ASP. net ajax structure is built based on the ASP. NET 2.0 localization model. It provides other support for localized. js files embedded in an assembly or on disks. ASP. NET can automatically provide localized client scripts and resources for specific languages and regions.

For more information, see the following topics:

  • Component Library resource localization Overview

  • Walkthrough: Embed localization resources into JavaScript files

Web Services

With the AJAX function in ASP. NET Web pages, you can use the client script to call ASP. NET Web services (. asmx) and Windows Communication Foundation (WCF) services (. svc ). The requested Script Reference will be automatically added to the page, and then they will automatically generate Web Service proxy classes. You can use these classes from client scripts to call Web Services.

You can also access ASP. NET Web services without using ASP. net ajax server controls (for example, if you use other Web development environments ). Therefore, you can manually include references to Microsoft AJAX Library, script files, and Web services on the page. At runtime, ASP. NET generates proxy classes that can be used to call these services. For more information, see Web Services in ASP. net ajax.

Application Service

The Application Service in ASP. NET is a built-in Web Service Based on ASP. NET Forms authentication, roles, and user configuration files. These services can be called by client scripts, Windows client applications, or WCF-compatible clients in pages that support AJAX. For information and examples, see use ASP. NET Web services.

Server Control

The ASP. net ajax server control consists of the server and client code, which can be integrated to generate a wide range of client behaviors. When you add an AJAX control to an ASP. NET webpage, the page automatically sends the supported client scripts to the browser for AJAX functionality. Other client code can be provided to customize controls, but this is not required.

The following list describes the most commonly used ASP. net ajax server controls.

Manages script resources for client components, partial page rendering, localization, globalization, and Custom User scripts. To use , And Control, you need Control.

This allows you to refresh the selected part of the page, instead of refreshing the entire page with synchronous sending.

Provide Status information updated by page in the control.

Perform sending back at a defined interval. Available Control to send the entire page, or Controls are used together to perform partial page update at defined intervals.

You can also create custom ASP. NET Server controls that contain AJAX client behaviors. Custom Controls used to enhance the functions of other ASP. NET Web controls are called extended controls ". For more information, see add AJAX functions and ASP. net ajax extension controls to ASP. NET controls.

AJAX control toolbox

The ASP. net ajax control toolbox is a collection of examples and components. These examples and components demonstrate some experience that can be created using ASP. net ajax controls and extensions. The Control Toolkit provides some examples and powerful sdks, which makes it easy to create and reuse custom controls and extensions. You can download the ASP. NET Ajax Control Toolkit from the ASP. net ajax website. The ASP. net ajax control toolbox is supported by the community.

Future versions supported by the AJAX Community

The future versions supported by the ASP. net ajax Community provide some features that will be used to extend ASP. NET's AJAX functions using features that are currently under development and not included in ASP. NET. This includes other extension controls and support for the client declarative syntax (xml-script. To download and learn more about future versions, visit ASP. net.

See add AJAX to ASP. NET controls for browser security settings on ASP. NET pages that support AJAX.

Send feedback to Microsoft on this topic.

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.