http:// lhu.edu.vn23 Điều khiển DataList This is trial version www.adultpdf.com... http:// lhu.edu.vn24 Điều khiển DataList This is trial version www.adultpdf.com... http:// lhu.edu.vn
Trang 1http:// lhu.edu.vn
23
Điều khiển DataList
This is trial version
www.adultpdf.com
Trang 2http:// lhu.edu.vn
24
Điều khiển DataList
This is trial version
www.adultpdf.com
Trang 3http:// lhu.edu.vn
25
Điều khiển DataList
Để hiển thị dữ liệu => sự kiện ItemDataBound
Xử lý nhấn nút bấm các button => sự kiện ItemCommand
This is trial version www.adultpdf.com
Trang 4http:// lhu.edu.vn
26
Điều khiển Repeater
<html>
<body>
<form runat="server">
<asp: Repeater id=“<ten>" runat="server">
<HeaderTemplate> </HeaderTemplate>
<ItemTemplate></ItemTemplate>
<AlternatingTemplate></AlternatingTemplate>
<SeparatorTemplate></SeparatorTemplate>
<FooterTemplate></FooterTemplate>:
</asp: Repeater > </form> </body> </html>
</body>
</html>
This is trial version www.adultpdf.com
Trang 5http:// lhu.edu.vn
27
Điều khiển Repeater
Gồm các tag sau đây:
<HeaderTemplate> </HeaderTemplate>:
<HeaderTemplate> </HeaderTemplate>: tùy chọn, tiêu đề đầu,
quy định hình thức hiển thị cho tiêu đ ề (chỉ xuất hiện 01 lần, phía trên của điều khiển)
<ItemTemplate></ItemTemplate>:
<ItemTemplate></ItemTemplate>: bắt buộc phải có, quy định
hình thức hiển thị cho các mục dữ liệu trong điều khiển
Lấy dữ liệu: <%#Container.DataItem(“ten field”)%>
Hay <%#Eval(“ten field”)%>
<AlternatingTemplate></AlternatingTemplate>(
<AlternatingTemplate></AlternatingTemplate>(tùy chọn): quy
định hình thức hiển thị cho các mục dữ liệu trong điều khiển Nội dung được quy định trong cặp tag này sẽ hiển thị xen kẽ
<ItemTemplate></ItemTemplate>:
This is trial version www.adultpdf.com
Trang 6http:// lhu.edu.vn
28
Điều khiển Repeater
<SeparatorTemplate></SeparatorTemplate>:
<SeparatorTemplate></SeparatorTemplate>: tùy chọn, quy
định hình thức hiển thị giữa các dòng dữ liệu
<FooterTemplate></FooterTemplate>:
<FooterTemplate></FooterTemplate>:quy định hình thức hiển
thị cho tiêu đ ề dưới( chỉ xuất hiện 01 lần, phía dưới của điều khiển)
This is trial version www.adultpdf.com
Trang 7http:// lhu.edu.vn
29
Điều khiển Repeater
Gồm các tag sau đây:
<HeaderTemplate> </HeaderTemplate>:
<HeaderTemplate> </HeaderTemplate>: tùy chọn, tiêu đề đầu,
quy định hình thức hiển thị cho tiêu đ ề (chỉ xuất hiện 01 lần, phía trên của điều khiển)
<ItemTemplate></ItemTemplate>:
<ItemTemplate></ItemTemplate>: bắt buộc phải có, quy định
hình thức hiển thị cho các mục dữ liệu trong điều khiển
Lấy dữ liệu: <%#Container.DataItem(“ten field”)%>
Hay <%#Eval(“ten field”)%>
<AlternatingTemplate></AlternatingTemplate>(
<AlternatingTemplate></AlternatingTemplate>(tùy chọn): quy
định hình thức hiển thị cho các mục dữ liệu trong điều khiển Nội dung được quy định trong cặp tag này sẽ hiển thị xen kẽ
<ItemTemplate></ItemTemplate>:
This is trial version www.adultpdf.com
Trang 8http:// lhu.edu.vn
30
Điều khiển Repeater
This is trial version
www.adultpdf.com
Trang 9http:// lhu.edu.vn
31
Điều khiển Repeater
This is trial version
www.adultpdf.com
Trang 10http:// lhu.edu.vn
32
Demo các điều khiển
GridView
DataList
DetailsView
Form View
This is trial version www.adultpdf.com
Trang 11www.adultpdf.com