ASP.NET AJAX Programmer’s Reference - Chapter 20

Using UpdatePanel in User Controls and Custom Controls Các chương trước đã phát triển một phần dựng hình cho phép tùy chỉnh kiểm soát tên BaseMasterDetailControl và BaseMasterDetailControl2, mà tôi sẽ sử dụng trong chương này để phát triển một phần dựng hình cho phép điều khiển máy chủ tùy chỉnh. Sau đó tôi sẽ sử dụng các ví dụ để cho bạn thấy làm thế nào để sử dụng AJAX vẽ trang một phần trong các ứng dụng web của riêng bạn. MasterDetailControl MasterDetailControl là một điều khiển máy chủ được thừa kế từ BaseMasterDetailControl2 và mở rộng chức năng. | on Using UpdatePanel in User Controls and Custom Controls The previous chapter developed two partial-rendering-enabled custom controls named BaseMasterDetailControl and BaseMasterDetailControl2 which I will use in this chapter to develop partial-rendering-enabled custom server controls. I ll then use examples to show you how to use AJAX partial page rendering in your own Web applications. MasterDetailControl MasterDetailControl is a server control that inherits from BaseMasterDetailControl2 and extends its functionality to use the Gridview as a master server control as shown in Listing 20-1. Listing 20-1 The MasterDetailControl Server Control using System using using using using using using using using using using using continued Chapter 20 Using UpdatePanel in User Controls and Custom Controls Listing 20-1 continued namespace Customcomponents public class MasterDetailControl BaseMasterDetailControl2 protected override BaseDataBoundControl CreateBaseDataBoundControlMaster GridView master new GridView true true true true MasterGridView return master protected override void RegisterMasterEventHandlers GridView Master .SelectedIndexChanged new EventHandler Master_SelectedIndexChanged GridView Master .PageIndexChanged new EventHandler Master_ResetSelectedValue GridView Master .Sorted new EventHandler Master_ResetSelectedValue public int PageSize get EnsureChildControls return GridView Master .PageSize set EnsureChildControls GridView Master .PageSize value TypeConverter typeof StringArrayConverter public string DataKeyNames get EnsureChildControls return GridView Master .DataKeyNames set 912 Chapter 20 Using UpdatePanel in User .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.