I have a collection List<Person> Persons, and in a Person there is a Country (Country.Name).
I have successfully bound my repeater to my collection, however trying write out the country name is giving me some troubles, also I have a a bool IsActive in my Persons, which I would like to show an icon instead of true/false.
protected void Page_Load(object sender, EventArgs e)
{
List<Person> persons = GetPersons();
RP_Persons.DataSource = persons;
RP_Persons.DataBind();
}
protected void RP_Persons_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
// How do I get my stuff here? I need to get the country name and be able to use a <div class="active"><img src='xxxx' /></div>
}
}
Here is my markup:
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "Email") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "Registered") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "Country") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "IsActive") %></td>
<tr>
</ItemTemplate>