Hi,
I have a repeater control with a usercontrol as the ItemTemplate. Just about everything is working fine except that only the last Item shows info from the original page code behind. It seems that when I set the label.text it overwrites until eventually showing only the final one.
code behind:
Code:
Protected Sub rptWineList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptWineList.ItemDataBound
Dim r As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim thisLabel As HyperLink
Try
'thisLabel = (CType(rptWineList.FindControl("linkWineName"), HyperLink))
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
'thisLabel.Text = r("WineName")
Response.Write("<strong>" & r("WineName") & "<br /></strong>")
'thisLabel.NavigateUrl = "/Wine/Wine_Detail.aspx?ID=" & r("WineID_PK")
'Response.Write(thisLabel.ID & "<br>")
End If
Catch ex As Exception
Response.Write(ex.ToString & "<br />")
End Try
End Sub
repeater control
Code:
<asp:Repeater ID="rptWineList" runat="server">
<ItemTemplate>
<Wine:ListView ID="wucWineViewList" Visible="true" runat="server" />
</ItemTemplate>
</asp:Repeater>
If anyone can help I'd really appreciate it.