DataList and Repeater are two very useful controls that are often used in news lists and in places where pictures are displayed. Let's introduce them briefly here.
1.DataList:
Front page:
<asp:datalist id= "piclist" runat= "Server" repeatcolumns= "3" width= "90%" repeatdirection= "Horizontal" > <itemstyle. Borderwidth= "0" borderstyle= "none" width= "horizontalalign=" center "/> <ItemTemplate> <table border= "0" cellpadding= "0" cellspacing= "0" width= "100%" > <tr> <td height= "110px" > ' width= "174" height= "" "style=" Cursor:hand; "/> </td> </tr> <TR > <td align= "center" height= "40px" > <asp:label id= "Content" runat= "Server" Width= "100%" Text= ' <%# Eval ("Imgms") %> '/></td> </tr> </table> </itemtemplate > </asp:DataList>
Property Description: RepeatColumns: The number of repetitions in the horizontal or scholarly way;
RepeatDirection: Repeat direction.
Background code:
This. Piclist.datasource = ds; Piclist.databind ();
2.Repeater: Easier to use,
<asp:repeater id= "Repeater3" runat= "Server" > <ItemTemplate> <div align= "left" Clas s= "DIVP1" > <a HRE F= ' talent.aspx?nurl=<%# eval ("Menuurl")%> ' target= "_blank" ><strong><%# eval ("MenuName")%> </strong></a>
</ItemTemplate> </asp:Repeater>
The background is similar to DataList.
DataList and Repeater