G
Guest
Hi Guys,
I have a sortedlist which holds a group of "CartItem" items. following is
the CartItem class:
Public Class CartItem
Public ProdID As Integer
Public Name As String
Public Price As Decimal
Public Quantity As Integer
End Class
I have a datalist control and want to bind a label to the Name property of
the CartItem(s) in the sortedlist - the result shoud be that for each item in
the sorted list will create a new entry in the datalist control with the data
in the Name property showing in the label.
My binding sub:
Dim ShoppingCart as sortedlist = Session("Cart")
dlsCart.DataSource = ShoppingCart.Values
dlsCart.DataBind()
The label text property binding string:
DataBinder.Eval(Container.DataItem, "Name")
When I run this, I get the followig exception:
ExTYPE: System.Web.HttpException
MESSAGE: DataBinder.Eval: 'myLNF.CartItem' does not contain a property
with the name Name.
What am I doing wrong?
I have a sortedlist which holds a group of "CartItem" items. following is
the CartItem class:
Public Class CartItem
Public ProdID As Integer
Public Name As String
Public Price As Decimal
Public Quantity As Integer
End Class
I have a datalist control and want to bind a label to the Name property of
the CartItem(s) in the sortedlist - the result shoud be that for each item in
the sorted list will create a new entry in the datalist control with the data
in the Name property showing in the label.
My binding sub:
Dim ShoppingCart as sortedlist = Session("Cart")
dlsCart.DataSource = ShoppingCart.Values
dlsCart.DataBind()
The label text property binding string:
DataBinder.Eval(Container.DataItem, "Name")
When I run this, I get the followig exception:
ExTYPE: System.Web.HttpException
MESSAGE: DataBinder.Eval: 'myLNF.CartItem' does not contain a property
with the name Name.
What am I doing wrong?