ASP.NET AJAX Programmer’s Reference with ASP.NET 2.0 or ASP.NET 3.5 phần 8

Sau đó, nó lặp lại thông qua các đối tượng ScriptReference trong bộ sưu tập Danh sách và thực hiện hai nhiệm vụ cho từng đối tượng ScriptReference liệt kê. Đầu tiên, nó khởi tạo một ví dụ ScriptReferenceEventArgs, đi qua trong một tham chiếu đến các đối tượng ScriptReference liệt kê. Như bạn sẽ thấy sau này, ScriptReferenceEventArgs | Chapter 22 AJAX Client-Side PageRequestManager if initialLoad If this isn t the first page load . we are doing an async postback we need to re-raise the Application s load event. As you can see for the highlighted portion of the preceding code listing this method invokes the _getPageLoadedEventArgs initialLoad internal method on the current PageRequestManager instance to instantiate and return an instance of the PageLoadedEventArgs class which is then passed into the event handlers registered for the pageLoaded event of the current PageRequestManager instance. I ll present and discuss the internal implementation of the _getPageLoadedEventArgs method in Chapter 28. Using the pageLoaded Event As I mentioned earlier the current client-side PageRequestManager instance fires its pageLoaded event at the end of its instantiation initialization process to enable you to perform application-specific tasks that must be performed right after the current PageRequestManager instance is instantiated and initialized. Follow these steps to ensure that your required application-specific logic is executed right after the current PageRequestManager instance is instantiated and initialized 1. If your required application-specific logic is encapsulated in a method of an AJAX client class invoke the createDelegate static method on the Function to instantiate a delegate that represents this method. If your required application-specific logic is not already encapsulated in a method of an AJAX client class write a new JavaScript function that encapsulates this logic. 2. Implement a JavaScript function that performs the following tasks Invokes the getInstance static method on the client-side PageRequestManager class to return a reference to the current client-side PageRequestManager instance Invokes the add_pageLoaded method on the current client-side PageRequestManager instance to register the delegate or the JavaScript function from Step

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
11    220    2    08-05-2024
242    68    1    08-05-2024
21    227    2    08-05-2024
Đã 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.