I have the following inside a repeater;
<sc:Link runat="server" DataSource='<%# (Container.DataItem as Item).Paths.Path %>' TextField="Title" LinkField="Title" />
This however fails. I have also tried with
<sc:Link runat="server" DataSource='<%# Container.DataItem %>' TextField="Title" LinkField="Title" />
Which also fails. What am i missing?
Try setting Item parameter instead of DataSource. I don't have many sc:Link controls in my code, but here is one I know works:
<sc:Link ID="hlMore" runat="server" Item='<%# Container.DataItem %>' Field="ImageLink" Text=<%# Sitecore.Globalization.Translate.Text("FindOutMore") %>></sc:Link>
Note it also uses "Field" and not TextField. Hmmmm. In the code behind, the data source is a List collection.
Here's another one, with a control inside it:
<sc:Link ID="lnkFlag" runat="server" Field="FlagLink" Item='<%# Container.DataItem %>'>
<sc:Image runat="server" Field="FlagImage" Item='<%# Container.DataItem %>' />
</sc:Link>
DataSource should be ID, not item or item.Path.
Item should be the datasource item.