Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET AJAX in Action phần 7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Liệt kê 4,13 cho thấy một đoạn mã cố ý ném một ngoại lệ sau khi người dùng đã lựa chọn một thể loại âm nhạc mới từ danh sách thả xuống. Danh sách 4,13 ném một ngoại lệ để xem cách xử lý Tìm hiểu các phần mở rộng máy chủ Ajax | Introduction to Ajax-enabled controls 309 Figure 9.6 In the extender model a server control receives the client functionality from the Extender control which provides the script references and script descriptors needed to wire a client component to the extended control. An ASP.NET AJAX extender is conceptually similar to an extender provider in Windows Forms. It keeps a portion of functionality separated from a server control and it provides additional properties to the extended control. These properties are used in turn to configure the properties of the client component that are associated with the extended control. NOTE To learn more about extender providers in Windows Forms browse to http msdn2.microsoft.com en-us library ms171835.aspx. If you decide that both the server and the client capabilities should be specified in the same place you need a script control. It s a server control that is created as an Ajax-enabled control and can provide script references and script descriptors without the need for an external object. Returning to the example of an auto-complete text box the AutoCompleteTextBox class that derives from TextBox is a good candidate for becoming a script control. This model is illustrated in figure 9.7. Deciding whether to build an extender or a script control is a design choice you should make based on the requirements of the web application. Typically an extender is the right choice when you want to plug client functionality into an existing server control without the need to create a new control. A script control is the right choice if you want complete control over its capabilities both on the server and on the client side. 310 CHAPTER 9 Figure 9.7 A script control is a server control that can both render markup code and provide the script references and script descriptors needed to instantiate client components. From a slightly different point of view the choice between an extender and a script control can be determined by the kind of .

TÀI LIỆU LIÊN QUAN