Hi,
This is a duplicate post but since I'm still searching for an answer I'm posting again. I apologise but I really need to find a solution to this problem.
I have a list of Installations, related to an Installation is a list of Images.
When listing Installations I want to select the 1st Image of the Image list related to the Installation.
Below is what I currently have, it obviously lists all images.
I'm
guessing I probably shouldn't be using a repeater but I can't figure
out how to bind anything else to an image datasource let alone have the
datasource return only the 1st image.
<asp:Repeater ID="rptInstallations" runat="server">
<ItemTemplate>
<div class="installation">
<asp:Repeater ID="CategoryID1" runat="server" DataSourceID="ImageFiter">
<ItemTemplate>
<asp:image id="Image" runat="server" ImageUrl='<%# "Upload/" +
Eval("ImageURL") %>' Title='<%#Eval("Caption") %>' />
</ItemTemplate>
</asp:Repeater>
<data:EntityDataSourceFilter ID="ImageFiter" runat="server"
DataSourceID="ImageDataSource" Filter='<%# String.Format("ObjectID =
{0}", Eval("ID")) %>' />
</ItemTemplate>
</asp:Repeater>
<data:ImageDataSource ID="ImageDataSource" runat="server" SelectMethod="GetAll" />
This seems like such a simple problem, it's frustrating i can't figure it out.
Should I be using a custom SP? how?
Should I be binding to an entity instead of a list? using a dataobjectsource? how?
Please help.