Foundations of ASP.NET AJAX phần 6

Chuyển qua chuyển lại tình trạng giữa các thay đổi được hoàn thành và đăng nhập các dữ liệu của GridView gần như ngay lập tức mà không cần bất kỳ làm mới trang. Bây giờ, hãy thêm một nhiệm vụ mới được gọi là "Trở thành một chuyên gia AJAX" và nhấn Insert trên UpdatePanel dưới của trang. | 122 CHAPTER 6 USING SERVER CONTROLS IN AJAX Figure 6-6. Viewing completed tasks Toggling the status between Completed and Active changes the data of the GridView almost instantaneously without any page refresh. Now let s add a new task called Become an AJAX expert and click Insert on the lower UpdatePanel of the page. You ll see the task being immediately added to the Active list as shown in Figure 6-7. CHAPTER 6 USING SERVER CONTROLS IN AJAX 123 Figure 6-7. Newly added task in the Active list As you can see the task was added to the active list with the TaskId of 7. The TaskId is an identity field in the table that is simply incremented with each new addition. Now if you were to mark the task completed by clicking the Edit link and then checking the Complete check box followed by the Update link you would see the contents of the UpdateProgress control while the update is taking place. Figure 6-8 shows the update in progress. 124 CHAPTER 6 USING SERVER CONTROLS IN AJAX Figure 6-8. Updating a task to mark it complete Upon updating the status change you can switch to the Completed view by toggling the main drop-down box and you ll see the recently created task marked as completed as shown in Figure 6-9. Also you can now delete a task by simply clicking the Delete .

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
25    92    2    29-06-2024
20    79    2    29-06-2024
283    642    1    29-06-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.