TAILIEUCHUNG - ASP.NET AJAX in Action phần 2

Đối với nhân viên tra cứu logic, tạo ra một lớp đơn giản được gọi là , và chép đoạn code trong danh sách . Danh sách 1,7 Một lớp học đơn giản mà trả về số lượng nhân viên trong một bộ phận | Introducing AJAX 24 CHAPTER 1 Figure The AJAX-Enabled Web Site template creates a website that references the AJAX assembly and configures the file for Ajax integration. For the employee lookup logic create a simple class called and copy the code in listing . Listing A simple class that returns the number of employees in a department using System public static class HumanResources public static int GetEmployeeCount string department int count 0 switch department case Sales count 10 break case Engineering count 28 break case Marketing AJAX in action 25 count 44 break case HR count 7 break default break return count The HumanResources class contains one method GetEmployeeCount which takes the department name as a parameter. It uses a simple switch statement to retrieve the number of employees in the department. To keeps things simple we hardcoded the department names and values. When you created the new website a default page named was also generated. Listing shows the initial version of the page. Listing Default page created by the AJAX-Enabled Web Site template @ Page Language C AutoEventWireup true CodeFile Inherits _Default DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD html xmlns http 1999 xhtml head runat server title Untitled Page title head body ScriptManager form id form1 runat server control asp ScriptManager ID ScriptManager1 runat server --- div div form body html What s different in this page from the usual default page created by Visual Studio is the addition of the ScriptManager control. We briefly defined the ScriptManager earlier in the chapter as the brains of an Ajax-enabled page. In this example all you need to know about the ScriptManager is that it s required to Ajax-enable a 26 CHAPTER 1 Introducing AJAX page it s responsible for delivering the client-side scripts to the

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.