1

I have a repeater inside a web user control .I need to bind it with the properties of another C# class (say abc.cs). Can anyone please let me know how to bind the repeater with properties of another C# class?

Note:i don't have properties in webusercontrol.cs file.They have been placed and being set in another C# class.

For example

  <asp:Label ID="lblCloseDate" Text='<%#Eval("Property Reference") %>' runat="server" />

Thank You.

Asp_Newbie
  • 269
  • 2
  • 9
  • 17
  • Have you tried using the Repeater's OnDataBound or OnItemCreated event to locate the label and set the value? – Derek Oct 30 '12 at 13:09
  • This question is in vb.net, otherwise possible duplicate: http://stackoverflow.com/questions/5517676/how-do-i-bind-a-gridview-to-a-custom-object – pseudocoder Oct 30 '12 at 13:10
  • You can't bind to an individual control, you need to put the control in a List. – Steve Wellens Oct 30 '12 at 13:18
  • Am I correct in assuming that you want to bind to _collection_ of classes? A repeater is used for ... well, repeating the same display for a collection of elements. If you only want to always display only a single instance of a class, there is no need for a repeater. Just use regular form elements. – Shai Cohen Oct 30 '12 at 21:44

0 Answers0