I need a way to write a certain line to the itemtemplate inside the datalist control if the current row being written is 1. This is what I have:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:DataList ID="MyDataList" RepeatColumns="2" runat="server">
<ItemTemplate>
<a href="/Vegas2/Celebrities/celebritybio.aspx?CelebID=<%# DataBinder.Eval(
Container.DataItem, "CelebID") %>">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table class="handlink" border="0" cellspacing="0" cellpadding="0"
onMouseOver="c2On(this);" onMouseOut="c2Out(this);"
onClick="window.location='/Vegas2/Celebrities/celebritybio.asp?CelebID=
<%# DataBinder.Eval(Container.DataItem, "CelebID") %>'">
'[if this is the first row, write the following:
'<tr>
'<td colspan="4"><img src="/Vegas2/images/2w12.gif" alt="" /></td>
'</tr>
'end the if]
<tr>
<td height="4" colspan="4"></td>
</tr>
<tr>
<td width="10"></td>
<td width="100" valign="center"><img src="<%# DataBinder.Eval(Container.DataItem,
"CelebPicSm") %>" alt="" /></td>
<td width="10"></td>
<td width="140"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="4"></td>
</tr>
<tr>
<td class="smalltxt">Name: <strong><%# DataBinder.Eval(Container.DataItem,
"CelebName") %></strong></td>
</tr>
<tr>
<td class="smalltxt">DOB: <%# String.Format("{0:d}",(DataBinder.Eval(
Container.DataItem, "DateofBirth"))) %></td>
</tr>
<tr>
<td class="smalltxt">
Age: <%# Age((String.Format("{0:d}",(DataBinder.Eval(Container.DataItem,
"DateofBirth")))),(DataBinder.Eval(Container.DataItem, "Dead"))) %> </td>
</tr>
<tr>
<td class="smalltxt">Career: <%# DataBinder.Eval(Container.DataItem,
"Career") %></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" height="4"></td>
</tr>
<tr>
<td colspan="4"><img src="/Vegas2/images/2w12.gif" alt="" style="margin-top:3px;" /></td>
</tr>
</table>
</td>
<td width="4"></td>
</tr>
</table>
</a>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td height="8"></td>
</tr>
</table>
I need to write an image to complete the surrounding box. If I have it write both at the top, and bottom, the separator becomes thick, and does not look nice. The image needs to be written above where it is said, but only if it is the first record being written. I cannot deal with the HeaderTemplate as some records will only return one result. If I use the header template to add the image to both columns and only one record is displayed viewing only one column, obviously it looks off. Thanks.