ASP: Repeater not working

notobtumoc

New Member
I've used this tutorial to use a repeater to display a list of names on a page on my project.So I'm using dynamic data and in my aspx.cs page I have:\[code\]List<string> subContractors = new List<string>();Context db = new Context();subContractors = (from SUBContractors in db.BOQ_SubContractors where SUBContractors.Bill_Of_Quantity_id == this.boqId select SUBContractors.Sub_Contractor.Company_Name).ToList();\[/code\]repeaterShowSubContractorName.DataSource = subContractors; repeaterShowSubContractorName.DataBind();In my aspx:\[code\]<asp:Repeater ID="repeaterShowSubContractorName" runat="server" OnItemDataBound="subContractors_ItemDataBound"> <HeaderTemplate> <table> <tr> <th> <asp:Label ID="SubConName" Text="SubContractor Name" runat="server"></asp:Label> </th> </tr> </table> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:Label ID="SubCon" Text='<%# Eval("subContractors") %>' runat="server"></asp:Label> </td> </tr> </ItemTemplate> </asp:Repeater>\[/code\]The error is coming from \[code\]OnItemDataBound="subContractors_ItemDataBound"\[/code\].What or where do I link this to? I have no \[code\]subContractors_ItemDataBound\[/code\] at the moment.
 
Back
Top