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<>
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
HResult=0x80131500
Message='Umbraco.Web.PublishedContentModels.TeamDocuments' does not contain a definition for 'GetPropertyValue'
Source=
Content Page to show uploaded files
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<>
}
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=
Thanks
Hi Matthew
First of all remove this line:
You always have Umbraco helper in views, just use "Umbraco" magic word.
The second block should be like that:
Thanks,
Alex
Hi Alex,
When i remove the first line from the view i get "an object reference is required.....".
If i leave it in and use your code to get the items i get a null reference message.
Thanks,
Matthew
is working on a reply...