Skip to content

Instantly share code, notes, and snippets.

@patocallaghan
Created August 22, 2012 23:03
Show Gist options
  • Save patocallaghan/3430422 to your computer and use it in GitHub Desktop.
Save patocallaghan/3430422 to your computer and use it in GitHub Desktop.
.Net Repeater functionality #csharp #repeater
////Adding this so I don't forget
/*
In code-behind
var list = GetList();
repeaterId.DataSource = list;
repeaterId.DataBind();
*/
<asp:repeater runat="server" id="spiceimages">
<HeaderTemplate>
<div class="spice-images">
</HeaderTemplate>
<ItemTemplate>
<div class="<%# SetFirstLastClass(Container.ItemIndex) %>" data-number="<%# Container.ItemIndex %>">
<img src="<%# ((CustomObject)Container.DataItem).ImageUrl %>" width="120" height="220" alt="Visual of <%# ((CustomObject)Container.DataItem).Name %>" />
</div>
</ItemTemplate>
<FooterTemplate>
</div>
</FooterTemplate>
</asp:repeater>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment