TAILIEUCHUNG - ASP.NET 4 Unleased - p 51

Using List Controls LISTING Show BulletedList HyperLinks Each list item has both its Text and Value properties set. The Text property contains the text that displays for the list item, and the Value property contains the URL for the other website. The Target property is set to the value blank. | 474 CHAPTER 10 Using List Controls LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD html xmlns http 1999 xhtml head id Head1 runat server title Show BulletedList HyperLinks title head body form id form1 runat server asp BulletedList id blWebsites DisplayMode HyperLink Target _blank Runat server asp ListItem Text Yahoo Value http asp ListItem Text Google Value http asp ListItem Text Deja Value http asp BulletedList form body html Each list item has both its Text and Value properties set. The Text property contains the text that displays for the list item and the Value property contains the URL for the other website. The Target property is set to the value blank. When you click one of the hyperlinks the page opens in a new window. WARNING The BulletedList control is different from the other List controls because it does not support the SelectedIndex SelectedItem and SelectedValue properties. From the Library of Wow eBook Creating a Custom List Control 475 Creating a Custom List Control All the List controls inherit from the base ListControl class. If you are not happy with the existing List controls you can build your own. In this section we create a custom List control named the MultiSelectList control that renders two list boxes and an Add and Remove button. You can click the buttons to move items between the two list boxes see Figure . FIGURE Using the MultiSelectList control. The custom control uses client-side JavaScript to move the items between the two list boxes. Using JavaScript enables you to avoid posting the page back to the server each time a list item is moved. The client-side JavaScript is standards-compliant so it works with all web browsers such as Internet Explorer Firefox Safari and Opera. The code for the custom MultiSelectList is contained in Listing . LISTING .

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.