I have the following code which inserts a button(s) on a page. It works fine for the first set but if another set it added lower down the page there is an error thrown:
The value of parameter 'id' must be either a string or an integer
@inherits UmbracoViewPage
@if (Model.Items.Any())
{
foreach (var item in Model.Items)
{
if (item.GetValue("buttonLink") != ""){
var node = Umbraco.Content(item.GetValue("buttonLink"));
<section class="socials-block container">
<div class="btn-holder">
<a href="@node.Url" class="btn-action"><span>@item.GetValue("buttonText")</span></a>
</div>
</section>
}
}
Multiple items on a page
I have the following code which inserts a button(s) on a page. It works fine for the first set but if another set it added lower down the page there is an error thrown:
The value of parameter 'id' must be either a string or an integer
@inherits UmbracoViewPage
@if (Model.Items.Any()) { foreach (var item in Model.Items) {
}
is working on a reply...