The below goes into the aspx page
<body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="rptrData" runat="server">
<ItemTemplate>
<%#DataBinder.GetDataItem(Container) %>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
</body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="rptrData" runat="server">
<ItemTemplate>
<%#DataBinder.GetDataItem(Container) %>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
</body>
The below goes into the aspx.cs page
using System;
public partial class BindEnumToRepeater_BindEnumToRepeater : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
rptrData.DataSource = Enum.GetNames(typeof(EFruits));
rptrData.DataBind();
}
}
public enum EFruits
{
Apple,
Orange,
Pinapple
}
public partial class BindEnumToRepeater_BindEnumToRepeater : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
rptrData.DataSource = Enum.GetNames(typeof(EFruits));
rptrData.DataBind();
}
}
public enum EFruits
{
Apple,
Orange,
Pinapple
}