Originally, the gridview was used to display the News Title List and link. Because the gridview does not display multiple columns, the datalist control is used for the first time to display the News Title List and link in two columns.
<Asp: datalist id = "dlsyxcf" runat = "server" performanceid = "odsnews" width = "476px" repeatcolumns = "2" repeatdirection = "horizontal">
<Itemtemplate>
<Table border = "0" cellpadding = "0" cellspacing = "0" style = "width: 238px">
<Tr>
<TD align = "Left" style = "width: pixel PX; Height: 14px" valign = "Middle">
<A href = shownewscontent. aspx? Id = <% # eval ("ID") %> Target = "_ blank"> <% # eval ("title") %> </a> </TD>
<TD align = "Left" style = "width: 48px; Height: 14px; color: Gray;" valign = "Middle">
<% # Eval ("timeissue", "{0: d}") %> </TD>
</Tr>
</Table>
</Itemtemplate>
</ASP: datalist>
To make the layout neat, the table is used in <itemtemplate> and the link is this statement:
<A href = shownewscontent. aspx? Id = <% # eval ("ID") %> Target = "_ blank"> <% # eval ("title") %> </a>
It feels too clumsy and there should be a better way.
Data Source Control: objectdatasource
<Asp: objectdatasource id = "odsnews" runat = "server" selectmethod = "getdstnewstitle"
Typename = "jobdatareader">
<Selectparameters>
<Asp: parameter defaultvalue = "1001001001001001001001001001003" name = "classid"/>
<Asp: parameter defaultvalue = "20" name = "showtop"/>
</Selectparameters>
</ASP: objectdatasource>