Hi ramco1917,
Please refer below sample.
HTML
<asp:Repeater ID="rptProduct" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>Name</td>
<td>Qty</td>
<td>Price</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="lblName" runat="server" Text='<%# Eval ("Name") %>'></asp:Label></td>
<td><asp:Label ID="lblQty" runat="server" Text='<%# Eval ("Qty") %>'></asp:Label></td>
<td><asp:Label ID="lblPrice" runat="server" Text='<%# Eval ("Price") %>'></asp:Label></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string name = "abc";
int qty = 1;
int price = 5000;
List<OrderDetails> orderDetails = new List<OrderDetails>();
orderDetails.Add(new OrderDetails
{
Name = name,
Qty = qty,
Price = price
});
rptProduct.DataSource = orderDetails;
rptProduct.DataBind();
}
public class OrderDetails
{
public string Name { get; set; }
public int Qty { get; set; }
public int Price { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim name As String = "abc"
Dim qty As Integer = 1
Dim price As Integer = 5000
Dim orderDetails As List(Of OrderDetails) = New List(Of OrderDetails)()
orderDetails.Add(New OrderDetails With {
.Name = name,
.Qty = qty,
.Price = price
})
rptProduct.DataSource = orderDetails
rptProduct.DataBind()
End Sub
Public Class OrderDetails
Public Property Name As String
Public Property Qty As Integer
Public Property Price As Integer
End Class
Output
Name |
Qty |
Price |
abc |
1 |
5000 |