如何将数据库的信息在用<marquee></marquee>和repeat动态显示
我本想我这样做就可以了,可是结果是没有数据显示,...
<marquee width= "222 " height= "178 " direction= "up " bgColor= "#ffaaaa ">
<asp:Repeater id= "rep_Info " runat= "server ">
<ItemTemplate>
<table width= "544 " height= "22 ">
<tr>
<td style= "WIDTH: 222px "> <%# DataBinder.Eval(Container.DataItem, "InfoTopic ")%> </td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</marquee>
请各位高手帮帮忙!!
------解决方案--------------------html页面绑定服务器端的方法可以解决:
具体实现:
<marquee direction= "left " onMouseOut= "this.start() " onMouseOver= "this.stop() " scrollamount=3 scrolldelay=0 > <%=BindProduct()%> </marquee>
public string BindProduct()
{
string href = " ";
DataTable dtProductType = DaoFactory.CreateProductTypeDao().GetByParentIdNullAndIsShow(DaoConst.productTypeIsShow);
if (dtProductType.Rows.Count > 0)
{
for(int i=0;i <dtProductType.Rows.Count;i++)
{
href += " <a href= ' " + RootPath + "DefaultModel/Products/ProductsMain.aspx?ProductTypeId= " + dtProductType.Rows[i][ "ProductTypeId "].ToString() + " ' > " + dtProductType.Rows[i][ "ProductTypeName "].ToString() + " " + " </a> ";
}
}
return href;
}