Repeater控制内容行数
小弟做了一个产品的页面,有一个问题感觉很怪,弄不好,想问问各位:
前台页面product.aspx,该页主要显示产品图片和产品的标题,我用Repeater控件来做,代码如下:
************************************************************
<div class= "Title "> <img src= "images/products.gif " alt = "无图片 " />
</div>
<div class= "Psort " > <asp:PlaceHolder ID= "PhMenu " runat= "server "> </asp:PlaceHolder> </div>
<div class= "TDeital ">
<asp:Repeater ID= "Repeater1 " runat= "server " >
<Itemtemplate>
<div class= "ProShow "> <div class= "ProShowImg " > <table border= "0 " width= "100% " height= "100% " cellpadding= "0 " cellspacing= "0 " > <tr> <td valign= "middle " align= "center " > <a href= ' <%# Eval( "ProductID ", "ProductDetail.aspx?id={0} ") %> ' > <img border=0 src= " <%# Eval( "Picture ") %> " onload= "ResizeImage(this,130,110) " alt = " " /> </a>
</td> </tr> </table> </div>
<div class= "ProShowName "> <%#Eval( "ProductName ")%> </div>
</div>
</Itemtemplate>
</asp:Repeater>
</div>
<div class= "page "> <asp:Label ID= "lblCurrentPage " runat= "server " Text= "Label "> </asp:Label> <asp:HyperLink ID= "lnkPrev " runat= "server "> 上一页 </asp:HyperLink>
<asp:PlaceHolder ID= "ph " runat= "server "> </asp:PlaceHolder>
<asp:HyperLink ID= "lnkNext " runat= "server "> 下一页 </asp:HyperLink> <br />
</div>
**************************************************************
注:页面显示的图片img 地址是从数据库中读出来塞到PageDataSource的,然后用PageDataSource来控制分页,但我想弄页面显示的图像只能显示两行,其余没显示出来的用分页功能来显示,问题也就在我弄这个页面时,页面都把我的产品图像都显示出来了,各位请教下,要怎么用Repeater控件控制
里面的图像只能在页面显示出2行内容和固定几个同样的列出来
-------------------------
请不要回复些什么采用SQL 查询出Top 前几个图像的回复,这不符合我项目的内容要求。假如可以用HTML控制可以说说详细的方法吗?
我要的显示的样式差不多是下面这样:
A1 A2 A3 A4
(产品a) (产品b) (产品c)(产品d)
A5