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
Hello
I am trying to create a Partial View that contains nested items which within it has a Multi URL picker.
This is what i have so far:
@{ var LinkImages = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("linksImagesNested"); foreach(var item in LinkImages) { var LinkURL = item.GetPropertyValue<Umbraco.Web.Models.Link>("LinkURL"); var LinkTitle = item.GetPropertyValue("LinkTitle"); var LinkText = item.GetPropertyValue("LinkText"); var LinkImg = item.GetPropertyValue<IPublishedContent>("LinkImg"); <div class="col-md-4 border"> <a href="@LinkURL"> gh @LinkURL.Url </a> </div> } }
The problem is that LinkURL.Url does not produce anything. I have tried several different ways and no further forward.
Any ideas?
Thanks
check type of object in
var LinkURL = item.GetPropertyValue<Umbraco.Web.Models.Link>("LinkURL");
maybe it has multiple items?
var LinkURL = item.GetPropertyValue<IEnumerable<Umbraco.Web.Models.Link>>("LinkURL");
Step forward but still cannot get the URL out.
I have tried this
<div class="col-md-4"> <center><div class="border"><a href="@LinkURL.Url"><img src="@LinkImg.Url"> <p>@LinkText</p> </a></div></center> </div>
But get this error
CS1503: Argument 1: cannot convert from 'method group' to 'object'
As Yakov said, you should check the type of result first like that
MultiUrlPicker returns IEnumebarable<Umbraco.Web.Models.Link> type
IEnumebarable<Umbraco.Web.Models.Link> type
This is the Page in question.
https://xpsbridge.sail-dev.com/lgps-employers/newsletters/
I have @LinkURL showing on the page.
Sorted thanks
I had not set the Max Value
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Partial View / Nested / Multi URL Picker
Hello
I am trying to create a Partial View that contains nested items which within it has a Multi URL picker.
This is what i have so far:
The problem is that LinkURL.Url does not produce anything. I have tried several different ways and no further forward.
Any ideas?
Thanks
check type of object in
maybe it has multiple items?
Step forward but still cannot get the URL out.
I have tried this
But get this error
CS1503: Argument 1: cannot convert from 'method group' to 'object'
As Yakov said, you should check the type of result first like that
MultiUrlPicker returns
IEnumebarable<Umbraco.Web.Models.Link> type
This is the Page in question.
https://xpsbridge.sail-dev.com/lgps-employers/newsletters/
I have @LinkURL showing on the page.
Sorted thanks
I had not set the Max Value
is working on a reply...