Preface:
From Treeview, to the gridview, to the repeater, although it has gone through "tossing", we have also summarized what we have learned. Here we will make a summary of the use of the repeater.
Resolution:
Use the same method as the previous blog post <pass the page and user control value> to replace the gridview with the Repeater control. The backgroundCodeSame, that is, specify the data source and then bind it. The front-end code is:
< ASP: repeater ID = " Rpremark " Runat = " Server " >
< Itemtemplate >
< Table border = " 0 " Width = " 100% " >
< Tr >
< TD Style = " Background-color: # eeeeee; color: #000000; font-size: 9pt; font-weight: 700; width: 300px; " >
<% # Databinder. eval (container. dataitem, " Author " ) %> & Nbsp & Nbsp
<% # Databinder. eval (container. dataitem, " Action " ) %>
[ <% # Databinder. eval (container. dataitem, " Create_time " ) %> ]
< / TD>
< TD align = " Right " Style = " Background-color: # eeeeee; color: #000000; font-size: 9pt; " >
<% # Databinder. eval (container. dataitem, " Display_author " ) %>
< / TD>
< / Tr>
< Tr >
< TD colspan = " 2 " Style = " Font-size: 9pt; padding: 5px; " > <% # Databinder. eval (container. dataitem, " Remark " ) %> < / TD>
< / Tr>
< / Table>
< / Itemtemplate>
< / ASP: repeater>
That is, the row data of the datatable is extracted and displayed. The result graph is as follows: