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
Hi,
I have returned a url with a razor loop, I want to render this out, how do I do it....my code below.
<umbraco:Macro runat="server" language="cshtml"> @{ var faq = Library.NodeById(1555); foreach(var item in faq.Children) { @item.umbracoFile; // this gives the url <img src="@item.umbrocoFile" /> // this does not render the image. } }</umbraco:Macro>
What is node 1555? Is it a document or a media item? Also, just guessing it's a typo, but in the image tag you're using umbrocoFile instead of umbracoFile.
You have misspell "@item.umbrocoFile" change to @item.umbracoFile
sorry...long day
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Redering an image with razor
Hi,
I have returned a url with a razor loop, I want to render this out, how do I do it....my code below.
<umbraco:Macro runat="server" language="cshtml">
@{
var faq = Library.NodeById(1555);
foreach(var item in faq.Children)
{
@item.umbracoFile; // this gives the url
<img src="@item.umbrocoFile" /> // this does not render the image.
}
}
</umbraco:Macro>
What is node 1555? Is it a document or a media item? Also, just guessing it's a typo, but in the image tag you're using umbrocoFile instead of umbracoFile.
You have misspell "@item.umbrocoFile" change to @item.umbracoFile
sorry...long day
is working on a reply...