tailieunhanh - Manning ASP.NET AJAX in Action PHẦN 6

Trong phần , bạn đã thấy như thế nào đối tượng JavaScript có thể được tạo ra như từ điển với tên và cặp giá trị. Mỗi cặp đại diện cho một tài sản của objectwe hardcoded Để tìm hiểu thêm về những nhà cung cấp mở rộng trong Windows Forms, trình duyệt | 252 CHAPTER 7 Under the hood of the UpdatePanel Now when a request is made you check to see if you re in the middle of an asynchronous postback. If so then you cancel the latest request to give precedence priority to the previous postback. To accomplish this make the updates to the onInitializeRequest handler shown in listing . Listing Aborting and canceling requests during partial updates function onInitializeRequest sender args var prm var details postBackElementID .id Save instance of PageRequestManager B if --------1 if .id Abort ec. i in asychronous v Tft H Y T- _ f-x C T M u- 1 4- else C postback true I ặp Cancel details canceled latest request var row createEventRow initializeRequest details get clientEvents .appendChild row We may be lazy but we pride ourselves on being proactively lazy. This example makes a copy of an instance of the B PageRequestManager so you can use it later in the function without all the extra typing. Next you check to see if you re currently in an asynchronous postback by getting the C isInAsyncPostBack property from the PageRequestManager. This makes sense because you want to abort and cancel a request only if you re currently in the middle of one. Finally if the Abort button wasn t the element that invoked the request you set the D cancel property to true to give priority to the previous request. Notifying the user Just before an asynchronous request is sent to the server the PageRequestManager raises the beginRequest event. Similar to the previous example the BeginRequest-EventArgs passed into this handler includes the postBackElement property. When raised this occurrence gives you the opportunity to notify the user about the upcoming postback before it begins. For lengthy operations what typically happens and is recommended is that the user is given a visual .

crossorigin="anonymous">
Đã 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.