Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2006, 09:06 AM
Registered User
 
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default repeater control only shows last Item info

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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
repeater control akssmv ASP.NET 2.0 Basics 1 August 20th, 2008 08:55 PM
Repeater Control Dhanapal General .NET 0 April 2nd, 2007 04:50 AM
listbox control items count shows 0. vikram_bendre ASP.NET 2.0 Basics 5 August 24th, 2006 08:37 AM
Repeater Control Dmitriy Pro VB 6 0 July 27th, 2004 11:13 AM
Referencing a Item in a Repeater saturdave ASP.NET 1.0 and 1.1 Basics 5 February 20th, 2004 03:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.