TAILIEUCHUNG - ASP.NET 4 Unleased - p 159

Các thuộc tính ConfigurationProperty rằng trang trí tài sản người dùng đặt tên của các thuộc tính cấu hình thành một chuỗi rỗng. Nó cũng đánh dấu sự sở hữu như đại diện cho bộ sưu tập mặc định của phần. Các tùy chọn này cho phép bạn tránh được việc phải tạo ra một subtag cho bộ sưu tập người dùng. | 1554 CHAPTER 34 Configuring Applications return new AdminUser protected override object GetElementKey ConfigurationElement element return AdminUser element .Name public AdminUsersCollection user public class AdminUser ConfigurationElement ConfigurationProperty name IsRequired true IsKey true public string Name get return string this name set this name value ConfigurationProperty password IsRequired true public string Password get return string this password set this password value The Configurationproperty attribute that decorates the Users property sets the name of the configuration attribute to an empty string. It also marks the property as representing the section s default collection. These options enable you to avoid having to create a subtag for the user collection. The user collection appears immediately below the main adminUsers section tag. The web configuration file in Listing illustrates how you can use the AdminUsersSection class. LISTING configuration configSections From the Library of Wow eBook Creating Custom Configuration Sections 1555 sectionGroup name section name adminUsers type allowLocation true allowDefinition Everywhere sectionGroup configSections adminUsers user name Bob password secret user name Fred password secret adminUsers configuration 34 The page in Listing displays all the users from the adminUsers section in a BulletedList control see Figure . FIGURE Displaying the contents of the adminUsers section in a BulletedList control. From the Library of Wow eBook 1556 CHAPTER 34 Configuring Applications LISTING @ Page Language C @ Import Namespace AspNetUnleashed @ Import Namespace DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server void Page_Load Get configuration .

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.