S
shapper
Hello,
I am binding a Repeater as follows:
Private Sub rFeedback_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles rFeedback.Load
If Not Page.IsPostBack Then
rFeedback.DataSource = "rFeedback_DataSource"
rFeedback.DataBind()
End If
End Sub ' rFeedback_Load
My datasource is as follows:
Private Function rFeedback_DataSource() As DataTable
Dim dtFeedback As New DataTable
dtFeedback.Columns.Add(New DataColumn("Message", GetType(String)))
Dim drFeedback As DataRow
For Each message As String In Me.Messages
drFeedback = dtFeedback.NewRow
drFeedback("Message") = message
dtFeedback.Rows.Add(drFeedback)
Next message
Return dtFeedback
End Function ' rFeedback_DataSource
Note: Me.Messages is a property of type Generic.List(Of String)
Inside my repeater I have a label which I bind, in an ITemplate class,
as follows:
lMessage.Text = DataBinder.Eval(container.DataItem, "Message")
I get the error, on this last code line:
Exception Details: System.Web.HttpException: DataBinding:
'System.Char' does not contain a property with the name 'Message'.
Any idea why?
I have no idea why is this hapenning.
Thanks,
Miguel
I am binding a Repeater as follows:
Private Sub rFeedback_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles rFeedback.Load
If Not Page.IsPostBack Then
rFeedback.DataSource = "rFeedback_DataSource"
rFeedback.DataBind()
End If
End Sub ' rFeedback_Load
My datasource is as follows:
Private Function rFeedback_DataSource() As DataTable
Dim dtFeedback As New DataTable
dtFeedback.Columns.Add(New DataColumn("Message", GetType(String)))
Dim drFeedback As DataRow
For Each message As String In Me.Messages
drFeedback = dtFeedback.NewRow
drFeedback("Message") = message
dtFeedback.Rows.Add(drFeedback)
Next message
Return dtFeedback
End Function ' rFeedback_DataSource
Note: Me.Messages is a property of type Generic.List(Of String)
Inside my repeater I have a label which I bind, in an ITemplate class,
as follows:
lMessage.Text = DataBinder.Eval(container.DataItem, "Message")
I get the error, on this last code line:
Exception Details: System.Web.HttpException: DataBinding:
'System.Char' does not contain a property with the name 'Message'.
Any idea why?
I have no idea why is this hapenning.
Thanks,
Miguel