Previously I tried this code:
protected override void OnInit(EventArgs e)
{
CMS.DataEngine.DataClassInfo dci = CMS.DataEngine.DataClassInfoProvider.GetDataClassInfo(Eval("ClassName").ToString(), true);
if (dci != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(dci.ClassFormDefinition);
// field name we added in the page type
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("Images");
CMS.FormEngine.FormFieldInfo ffi1= fi.GetFormField("Reports");
Guid AttachmentGroupGUID = ffi.Guid;
Guid AttachmentGroupGUID1= ffi1.Guid;
ucDocAttachments.Path = Eval<string>("NodeAliasPath");
ucDocFileAttachs.Path = Eval<string>("NodeAliasPath");
ucDocAttachments.AttachmentGroupGUID = AttachmentGroupGUID;
ucDocFileAttachs.AttachmentGroupGUID = AttachmentGroupGUID1;
ucDocAttachments.TransformationName = "CMS.Root.Attachment";
ucDocFileAttachs.TransformationName = "CMS.Root.AttachmentList";
ucDocAttachments.ReloadData(true);
ucDocFileAttachs.ReloadData(true);
}
}
where in AttachmentList transformation I have this:
< div>
<a target="_blank" href="<%# GetAbsoluteUrl(GetAttachmentUrl(Eval("AttachmentName"), Eval("NodeAliasPath")), Eval < int>("AttachmentSiteID")) %>" download >
<%# Eval("AttachmentName",true) %>
< /a>
< /div>
but it returns this error: [Error loading the control 'Repeater', check event log for more details]