我有一堆图像存储在Ektron的库中。我试图在幻灯片中的某个网页上显示这些图像。这就是我所拥有的:
public partial class WebAssets_UserControls_uxSlideShow : System.Web.UI.UserControl
{
public List<String> images { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
List<LibraryData> libraryImageList = GetLibraryDataList(1);
var imageList = (from im in libraryImageList
where im.FolderName == "Alumni"
select im).ToList();
var imageUrls = imageList.Select(image => image.FileName).ToList();
SlideShowRepeater.DataSource = imageUrls;
SlideShowRepeater.DataBind();
}
private List<LibraryData> GetLibraryDataList(int libraryTypeId)
{
LibraryManager libraryManager = new LibraryManager(ApiAccessMode.LoggedInUser);
LibraryCriteria criteria = new LibraryCriteria(LibraryProperty.Id, EkEnumeration.OrderByDirection.Descending);
criteria.AddFilter(LibraryProperty.TypeId, CriteriaFilterOperator.EqualTo, libraryTypeId);
// criteria.AddFilter(LibraryData.FolderName, CriteriaFilterOperator.EqualTo, libraryFolderName);
List<LibraryData> libraryDataList = libraryManager.GetList(criteria);
return libraryDataList;
}
}
和HTML ...
<div id="slideShowImages" class="flexslider">
<ul class="slides">
<asp:Repeater ID="SlideShowRepeater" runat="server">
<ItemTemplate>
<li>
<img alt="Alumni Events" src="<%# Container.DataItem %>" height="240" width="632" />
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
我提取的图片网址不起作用。找不到路径。图像的路径如下所示:
/uploadedimages/Alumni/001.jpg
我认为他们没有显示的原因是因为我的项目中没有uploadimages文件夹,而是该文件夹位于Ektron中,但我不知道要更改什么来显示图像。< / p>
答案 0 :(得分:1)
Ektron假设图像默认是本地的。
如果您的Ektron实例是公开的,您必须将路径修改为绝对路径,例如http://www.example.com/uploadedImages/Alumni/001.jpg
或:
如果Ektron安装不公开,就像在3层部署中那样,那么您有三个选择: