|
protected void Repeater_ItemDataBound (object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemIndex == 0)
{
HtmlImage Image1 = (HtmlImage) e.Item.FindControl ("pic");
if (Image1! = null)
Image1.Visible = true;
}
}
Or all the pictures are displayed, what's the problem?
<asp: Repeater id = "Shops1" OnItemDataBound = "Repeater_ItemDataBound" runat = "server">
<ItemTemplate>
<div style = "border: 1px # D6D4D4 solid; padding: 3px"> <a href="/Shop/ShopDetail.aspx?ShopId=<%# Eval("Id")%> "> <img id =" pic "Visible =" false "width =" 150 "src =" <% # Eval ("Image")%> "> </a> </ div>
<a class="blues" href="/Shop/ShopDetail.aspx?ShopId=<%# Eval("Id")%> "> <% # Eval (" Name ")%> </a> <br>
</ ItemTemplate>
</ asp: Repeater> |
|