本文整理汇总了C#中ContentAPI.GetChildContentByFolderId方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetChildContentByFolderId方法的具体用法?C# ContentAPI.GetChildContentByFolderId怎么用?C# ContentAPI.GetChildContentByFolderId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.GetChildContentByFolderId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateTreeHtml
/// <summary>
/// Generates the HTML for the child folders under the given folder
/// </summary>
/// <param name="controlId">The ID of the surrounding AJAX folder control.</param>
/// <param name="folderId">The folder ID.</param>
/// <returns>The HTML list element for one row of the folder tree.</returns>
protected string GenerateTreeHtml(string controlId, long folderId, string username, string password)
{
contentAPI = new Ektron.Cms.ContentAPI();
siteAPI = new SiteAPI();
if (!siteAPI.IsLoggedIn)
return "<div class=\"ekError\">Please login</div>";
List<ContentData> contentList = null;
try{
int totalPages = 1;
contentList = new List<ContentData>(
contentAPI.GetChildContentByFolderId(folderId, false, "Title", 0, ref totalPages, 300));
}
catch
{
}
StringBuilder sb = new StringBuilder();
if (contentList != null)
{
if (contentList.Count != 0)
{
sb.Append("<ul>");
foreach (ContentData content in contentList)
{
sb.Append("<li><a href='#' onclick='ekSelectContent" + controlId + "(this, " + content.Id + ", \"" + controlId + "\");' >" + content.Title + "</a></li>");
}
sb.Append("</ul>");
}
}
return sb.ToString();
}