The Repeater control of the ASPX page:
CopyCode The Code is as follows: <asp: repeater id = "indextopmain" runat = "server">
<Headertemplate> <! -- Header -->
<Ul>
</Headertemplate>
<Itemtemplate> <! -- Intermediate loop -->
<Li> • <a href = "aritcledisplay. aspx? Id = <% # eval ("ID") %> "Title =" <% # eval ("title ") %> "target =" _ blank "> <% # eval (" title "). tostring (). length> 30? Eval ("title"). tostring (). substring (0, 30) + "...": eval ("title") %> </a> </LI>
</Itemtemplate>
<Footertemplate> <! -- Tail -->
</Ul>
</Footertemplate>
</ASP: repeater>
Binding CS files
Copy codeThe Code is as follows: String indextopmainstr = "select Top 9 ID, title from Table order by id desc ";
Sqldataadapter rst = new sqldataadapter (indextopmainstr, Conn );
Conn. open ();
Dataset RDT = new dataset ();
RST. Fill (RDT );
Indextopmain. datasource = RDT; // Data Binding
Indextopmain. databind ();
Conn. Close ();