TAILIEUCHUNG - ASP.NET 4 Unleased - p 70

Chú ý Trong ASP NET ., LayoutTemplate được yêu cầu và nó cần thiết để có một điều khiển serverside với một ID của itemContainer. Trong ASP NET 4., LayoutTemplate không còn cần thiết. | 664 CHAPTER 14 Using the ListView and DataPager Controls NOTE In ASPNET the LayoutTemplate was required and it needed to contain a serverside control with an ID of itemContainer. In ASPNET 4 LayoutTemplate is no longer required. FIGURE Displaying database records with a ListView control. The ItemTemplate renders each of the items from the data source or every other item when an AlternatingItemTemplate is present . In Listing the ItemTemplate renders a div tag with a solid border. A data-binding expression is used with the div tag to display the value of the database Title column. The AlternatingItemTemplate is optional. If it is present every other item displayed by the ListView control is rendered with the AlternatingItemTemplate. In Listing the AlternatingItemTemplate is used to give alternating items a silver background color. Finally the EmptyDataTemplate displays content when no results are retrieved from the data source. In Listing the EmptyDataTemplate is used to display the text No Records Found when no items are returned from the data source. You can use the ListView control to render any HTML elements you can imagine. You can use the ListView control to render bulleted lists an HTML table a blog tag cloud or even the elements of a JavaScript array. For example the page in Listing uses a ListView control to render an HTML table. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head id Head1 runat server From the Library of Wow eBook Using the ListView Control 665 title Table ListView title head body form id form1 runat server div asp ListView ID lstMovies DataSourceId srcMovies runat server LayoutTemplate table thead tr th Title th th Director th tr thead tbody asp Placeholder id itemPlaceholder runat server tbody table LayoutTemplate ItemTemplate tr td Eval Title td td Eval .

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.