【发布时间】:2013-01-07 13:41:40
【问题描述】:
我正在使用 Telerik Sitefinity 5.1。我已经构建了一个具有 3 个字段 {title, url, image} 标题和 url -> 字符串字段的模块 图片 -> '图片选择器'
.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>
使用Text='<%# Eval("title") %>' 获取title 和url 字段但不知道如何获取这样的图像。谁能给我看看?
提前致谢。
【问题讨论】:
标签: c# telerik sitefinity sitefinity-5