今天要做一个图片也可以连接的datalist,考虑了一下,并尝试如下:结果成功了。
<a href="/shop/xianxi1.asp?id=<%# Eval("id","{0}") %>" target="_blank">
<asp:Image ID="Image1" runat="server" Height="154px" Width="154px" ImageUrl='<%# Eval("dt","/tp/image_cp/{0}") %>' /></a>
<asp:DataList ID="DataList1" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" OnItemDataBound="DataList1_ItemDataBound">
<ItemTemplate>
<table width="170" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center" class="zkq_02">
<a href="/shop/xianxi1.asp?id=<%# Eval("id","{0}") %>" target="_blank">
<asp:Image ID="Image1" runat="server" Height="154px" Width="154px" ImageUrl='<%# Eval("dt","/tp/image_cp/{0}") %>' /></a></div></td>
</tr>
<tr>
<td align="center"><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("id","/shop/xianxi1.asp?id={0}") %>' Text='<%# Eval("mc") %>'></asp:HyperLink><br />
市场价:<span class="zkqdel">¥<asp:Label ID="Label1" runat="server" Text='<%# Eval("jg1") %>'></asp:Label>元</span><br />
折扣价:<span class="zkqred">¥<asp:Label ID="Label2" runat="server" Text='<%# Eval("jg2") %>'></asp:Label>元</span>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>