Hi ramco1917,
Please refer below sample.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.se_status { }
.green { background-color: Green; width: 150px; height: 20px; text-align: center; padding-top: 5px; }
.red { background-color: Red; width: 150px; height: 20px; text-align: center; padding-top: 5px; }
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater ID="rptStudents" runat="server">
<ItemTemplate>
<div class="col-lg-7 col-12">
<div class="se_status">
<span>Present</span>
<div class='<%# Eval("Status").ToString().Trim() == "Pending" ?"green":"red" %>'>
<asp:Literal ID="ltrlStatus" runat="server" Text='<%# Eval("Status").ToString().Trim() %>'></asp:Literal>
</div>
</div>
</div>
<div> <br />
</div>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
Namespace
using System.Data;
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindRepeater();
}
}
protected void BindRepeater()
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] { new DataColumn("Name"),
new DataColumn("Status")});
dt.Rows.Add("Mudassar Khan", "Pending");
dt.Rows.Add("Robert Richerd", "Delivered");
dt.Rows.Add("Alex", "Pending");
rptStudents.DataSource = dt;
rptStudents.DataBind();
}
Screenshot