I'm using Telerik Sitefinity 5.1. I've build a module that has 3 fields {title, url, image} title and url -> string field image -> 'image selector'
.cs
protected void Page_Load(object sender, EventArgs e)
{
var myCollection = GetDataItems();
RadRotator1.DataSource = myCollection;
RadRotator1.DataBind();
}
public IQueryable<DynamicContent> GetDataItems()
{
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type brandLogosType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.BrandLogos.BrandLogos");
var myCollection = dynamicModuleManager.GetDataItems(brandLogosType).Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible == true);
return myCollection;
}
asp.x
<telerik:RadRotator ID="RadRotator1" runat="server" RotatorType="AutomaticAdvance"
BorderWidth="4px" Width="100px" Height="100px" ScrollDirection="Down">
<ItemTemplate>
<asp:Image runat="server" ID="image1" />
<%-- <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("title") %>'></asp:Label>--%>
<asp:Image ID="img1" runat="server" ImageUrl='<%# Eval("UrlWithExtension") %>' />
</ItemTemplate>
Getting title
and url
field with Text='<%# Eval("title") %>'
But don't know how to get image like this. Can somebody show me?
Thanks in advance.