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
I'm not sure what's wrong with this code. It seems pretty straightforward:
@{ var node = @Model.NodeById(@Parameter.adNode).Children.ElementAt(new Random().Next(0, @Model.NodeById(@Parameter.adNode).Children.Count() - 1)); }<div> <img src="@Model.GetMedia(@node.image)" /> <div class="fb-like" data-href="@node.likeLink" data-send="false" data-layout="button_count" data-width="250" data-show-faces="false"></div></div>
Here's how the template uses it:
<umbraco:Macro Alias="ShowAd" adNode="1363" runat="server"></umbraco:Macro>
Any ideas why I could get the "Cannot invoke a non-delegate type" error?
The goal of this macro is to pick a random ad node and render its contents.
A late reply, but what exactly are you trying to do here?? I'm sure there's an easier way of doing things then going trough an array of items, that just looks painful.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error: Cannot invoke a non-delegate type
I'm not sure what's wrong with this code. It seems pretty straightforward:
Here's how the template uses it:
Any ideas why I could get the "Cannot invoke a non-delegate type" error?
The goal of this macro is to pick a random ad node and render its contents.
A late reply, but what exactly are you trying to do here?? I'm sure there's an easier way of doing things then going trough an array of items, that just looks painful.
is working on a reply...