Hi, I need some help. I want a content page where a content editor can upload files(pdf’s, Word docs etc) and then viewed on the website. I have the following structure to achieve this. Any idea how i can fix this or use a better way of displaying uploaded files to a page?
I have a content page called Team Documents where you can upload the files using a document type which has a TreePicker.
I then have the code below , in the Template, which i want to loop through the page and display the url for each document.
@{
Layout = “Master.cshtml”;
}
@{
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
var teamDocuments = Model.Content.GetPropertyValue<IEnumerable>(“TeamDocuments”);
foreach (var item in teamDocuments)
{
<img src="item.Url" style="width:200px" />
}
}
When i run this code i get the error below:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
HResult=0x80131500
Message=‘Umbraco.Web.PublishedContentModels.TeamDocuments’ does not contain a definition for ‘GetPropertyValue’
Source=
StackTrace:
Thanks
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/95858-content-page-to-show-uploaded-files