Explore Microsoft ASP.net AJAX Control Development Technology (server side)

Source: Internet
Author: User
Tags inheritance interface net require client

First, Introduction

So far, we've discussed the client-related techniques involved in developing AJAX controls. Now, let's discuss some of the technologies that are relevant to the server side of the process.

It is to be explained that our example in the "Client" section is essentially simply the use of object-oriented JavaScript technology provided by the ASP.NET Ajax framework to enhance a client-side image component, It's not obvious that Ajax technology is involved (except that ScriptManager downloads and manages client script code in the background Ajax). So, this example is simple, and the enhanced control can be used only with client-related knowledge.

However, in actual development, when the client controls to be enhanced involve AJAX technology, or simply want to enhance server-side components such as UpdatePanel controls, we must do relevant server-side programming, This requires that we have an understanding of the classes associated with the server connected that are involved in AJAX control development. Also, it is essential to develop knowledge about ASP.net 2.0 server controls, especially when developing complex Ajax controls.

In this article, we'll reconstruct an enhanced image button control Mysrvimagebutton, which will be based on the ASP.net 2.0 server control ImageButton.

Second, AJAX control development server-side related technologies

First, let's take a look at the AJAX control development server-side related components and their relationships, as shown in Figure 1 in the inheritance diagram between these classes.

  

Figure 1: Hierarchy diagram between the primary server-side classes involved in control development

The diagram above shows the inheritance relationships between components, controls, and extenders. As you can see, in order to develop a control (note that component and Extender are not covered in this article), we have two choices: first, create a class that derives from ScriptControl, and then create a class that implements the IScriptControl interface. However, if you want to make your control derive from WebControl, then ScriptControl should be a better choice-because it is derived from the WebControl control itself. However, it is more appropriate to implement IScriptControl if you want to create your control from scratch and do not require any intrinsic features of WebControl to be implemented. In addition, choosing to use an interface when you want to add AJAX features to an existing control (such as the Mysrvimagebutton in this article) IScriptControl also be your choice. However, both of these methods require that the following two methods be overloaded: ①, Getscriptdescriptors;②, getscriptreferences.



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.