Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
umbraco v 4.11.4 (Assembly version: 1.0.4780.19111)
@{ dynamic file = Model.Descendants("Listing").First().downloadLink.mediaItem.File; <a href="@file.umbracoFile">DOWNLOAD</a>}
foreach(var itemx in Model.Descendants("Listing")) { dynamic file = itemx.dampFile.downloadLink.File; <p>@file.umbracoFile</p> }
What error do you get? It might be easier to use the DAMP Razor Model (use the version for "old" Razor) for this.
You could also have a look at the DAMP samples package. It also has a foreach. You can see the source here.
Jeroen
Thanks JeroenI used @itemx.downloadLink.First.File in the end instead of itemx.dampFile.downloadLink.FileCheers, Pete
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
DAMP doesn't work in foreach loop
umbraco v 4.11.4 (Assembly version: 1.0.4780.19111)
This works:
This does not:
What error do you get? It might be easier to use the DAMP Razor Model (use the version for "old" Razor) for this.
You could also have a look at the DAMP samples package. It also has a foreach. You can see the source here.
Jeroen
Thanks Jeroen
I used @itemx.downloadLink.First.File in the end instead of itemx.dampFile.downloadLink.File
Cheers, Pete
is working on a reply...