高手请进,Repeater输出,第1条记录输出,某个参数固定
这是我现在的代码
前台页面
<asp:Repeater ID="Top_GG01" runat="server"><ItemTemplate> <div class="dis" name="f"><a href="ProductDef.aspx?id=344" target="_blank"><img src="../upload_pic/Pro/<%# Eval("picture_b")%>" onload= "resize(this,this.height)"/></a></div></ItemTemplate></asp:Repeater>
public void ProTop_1() { ODBdata da = new ODBdata(); string sql = "select top 5 * from product where isEncrypt=false order by ID desc"; DataSet ds = da.ExceDS(sql); PagedDataSource pds = new PagedDataSource(); Top_GG01.DataSource = ds.Tables[0].DefaultView; Top_GG01.DataBind(); }
<div class="dis" name="f"><a href="ProductDef.aspx?id=344" target="_blank"><img src="../upload_pic/Pro/<%# Eval("picture_b")%>" onload= "resize(this,this.height)"/></a></div><div class="undis" name="f"><a href="ProductDef.aspx?id=344" target="_blank"><img src="../upload_pic/Pro/<%# Eval("picture_b")%>" onload= "resize(this,this.height)"/></a></div><div class="undis" name="f"><a href="ProductDef.aspx?id=344" target="_blank"><img src="../upload_pic/Pro/<%# Eval("picture_b")%>" onload= "resize(this,this.height)"/></a></div>
<a class='<%# Container.ItemIndex==0?"dis":"undis" %>'>ssss</a>