我正在使用Telerik Sitefinity 5.1。我已經建有3個字段{標題,URL,圖片}標題和URL模塊 - >串場 圖像 - > '圖像選擇'從Telerik Sitefinity模塊獲取圖像
的.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>
獲取title
和url
場Text='<%# Eval("title") %>'
但是不知道怎麼弄的圖像是這樣的。有人可以告訴我嗎?
在此先感謝。