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 using version 4.11.3 and uComponents 5.3.2 and I have a problem with Multi-URL Picker.
My XML is;
<relatedLinks> <multi-url-picker> <url-picker mode="URL"> <new-window>True</new-window> <node-id /> <url>www.vg.no</url> <link-title>Link 1</link-title> </url-picker> <url-picker mode="Content"> <new-window>False</new-window> <node-id>1054</node-id> <url>/en/about/</url> <link-title>Link 2</link-title> </url-picker> </multi-url-picker> </relatedLinks>
and my Razor script is;
@foreach (var link in Model.relatedLinks.urlpicker) { <p> <a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a><br /> </p> }
This gives me the following error;
uComponents.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState does not contain a definition for urlpicker
What am I doing wrong?
Hi,
at the moment i'm not sure but try this: Model.relatedLinks.Items
@foreach (var link in Model.relatedLinks.Items) { <p> <a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a><br /> </p>}
Thanks, Stevo
"Model.relatedLinks.Items" solved it. I had to rename all properties to get the output I wanted;
@foreach (var link in Model.relatedLinks.Items) { <p> <a class="btn" href="@link.Url" @Html.Raw(link.NewWindow ? "target=\"_blank\"" : "")>@link.Title</a><br /> </p> }
you are welcome, i'm glad i could help.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Problem with uComponents Multi-URL Picker
I'm using version 4.11.3 and uComponents 5.3.2 and I have a problem with Multi-URL Picker.
My XML is;
<relatedLinks>
<multi-url-picker>
<url-picker mode="URL">
<new-window>True</new-window>
<node-id />
<url>www.vg.no</url>
<link-title>Link 1</link-title>
</url-picker>
<url-picker mode="Content">
<new-window>False</new-window>
<node-id>1054</node-id>
<url>/en/about/</url>
<link-title>Link 2</link-title>
</url-picker>
</multi-url-picker>
</relatedLinks>
and my Razor script is;
@foreach (var link in Model.relatedLinks.urlpicker)
{
<p>
<a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a><br />
</p>
}
This gives me the following error;
uComponents.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState does not contain a definition for urlpicker
What am I doing wrong?
Hi,
at the moment i'm not sure but try this: Model.relatedLinks.Items
Thanks, Stevo
"Model.relatedLinks.Items" solved it. I had to rename all properties to get the output I wanted;
@foreach (var link in Model.relatedLinks.Items)
{
<p>
<a class="btn" href="@link.Url" @Html.Raw(link.NewWindow ? "target=\"_blank\"" : "")>@link.Title</a><br />
</p>
}
you are welcome, i'm glad i could help.
is working on a reply...