高手进,在线求助 !!!!转化问题 在线等
本帖最后由 skyxuyan 于 2013-04-05 19:48:19 编辑
<ul>
<li><a href="detail.aspx?ID=19" rel="改造"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/04.jpg" /></a>
<a href="detail.aspx?ID=17" rel="规划"><img height="100" width="100" alt=",在线 !转化有关问题" src="image/05.jpg" /></a>
<a href="detail.aspx?ID=21" rel="石家庄"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/02.jpg" /></a></li>
<li><a href="detail.aspx?ID=11" rel="汇通"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/07.jpg" /></a>
<a href="detail.aspx?ID=7" rel="东西"><img height="100" width="100" alt=",在线 !转化有关问题" src="image/10.jpg" /></a>
<a href="detail.aspx?ID=1" rel="亚洲"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/06.jpg" /></a></li>
<li><a href="detail.aspx?ID=3" rel="广州"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/08.jpg" /></a>
<a href="detail.aspx?ID=5" rel="新"><img height="100" width="100" alt=",在线 !转化有关问题" src="image/09.jpg" /></a>
<a href="detail.aspx?ID=15" rel="谷"><img width="100" height="100" alt=",在线 !转化有关问题" src="image/01.jpg" /></a></li>
</ul>
<asp:DataList ID="DataList1" runat="server" HorizontalAlign="Center" RepeatColumns="8">
<ItemTemplate>
<table>
<tr>
<td >
<a href='PicDetail.aspx?id=<%#Eval("id") %>' rel='<%#PartSubStringShort(DataBinder.Eval(Container.DataItem, "ProductInfo").ToString())%>'>
<img width="100" height="100" alt=",在线 !转化有关问题" src='<%#Eval("ProductImage") %>' />
</a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
protected void DTL_product_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item
[解决办法]
e.Item.ItemType == ListItemType.AlternatingItem)
{
if(e.Item.ItemIndex==0)
{
((Label)e.Item.FindControl("lbl_hr")).Text ="<li>";
}
else if (e.Item.ItemIndex%4==0)
{
((Label)e.Item.FindControl("lbl_li")).Text = "<li>";
}
else if (e.Item.ItemIndex%3==0)
{
((Label)e.Item.FindControl("lbl_hr")).Text = "</li>";
}
}
}