I have a page that has a formview and two repeaters that use separate
objectdatasources. Each objectdatasource returns records that contain
a field named DateAndTime. The problem I'm having is that in the
repeaters the value of the DateAndTime databound label is the value
from the first objectdatasource. Do I need to specify in the label
databinding what objectdatasource to use even though it's specified in
the repeater declaration?
Code:
<asp:FormView ID="fvAppendix1" runat="server"
DataKeyNames="PK_Appendix1ID" DataSourceID="Appendix1DataSource">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:FormView>
<asp:Repeater ID="rptAppendix1Readings" runat="server"
DataSourceID="Appendix1ReadingsDataSource"
OnItemDataBound="rptAppendix1Readings_ItemDataBoun d">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:Repeater>
<asp:Repeater ID="rptAppendix1PaintStorageReadings" runat="server"
DataSourceID="Appendix1PaintStorageReadingsDataSou rce"
OnItemDataBound="rptAppendix1PaintStorageReadings_ ItemDataBound">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:Repeater>
<asp:ObjectDataSource ID="Appendix1DataSource" runat="server"
SelectMethod="GetAppendix1ByAppendix1ID" TypeName="Appendix1BLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="Appendix1ReadingsDataSource" runat="server"
SelectMethod="GetAppendix1ReadingsByAppendix1ID"
TypeName="Appendix1ReadingsBLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="Appendix1PaintStorageReadingsDataSource"
runat="server" SelectMethod="GetAppendix1PaintStoragesByAppendix1 ID"
TypeName="Appendix1PaintStoragesBLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>
-Sean