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 All,
Im having an issue with my partial view for a button. I had created a button using the Multi URL Picker & Doc Type Grid Editor.
I have previously got it working, but the code has issues now that packages have been updated.
Im getting the error:
System.NullReferenceException: Object reference not set to an instance of an object.
Im using Umbraco 7.7.2, Multi Url Picker 2.0.1, DTGE 0.4.0.
Any help would be appreciated.
Martin.
@inherits Umbraco.Web.Mvc.UmbracoViewPage @using RJP.MultiUrlPicker.Models; @{ var button = Model.GetPropertyValue<MultiUrls>("buttonConfig"); if (button.Any()) { foreach (var item in button) { <a class="button" href="@item.Url" target="@item.Target">Explore</a> } } }
Hi Martin
Are Property Value Converters enabled?
If yes, this code should work:
foreach (var item in Model.ButtonConfig) { <a class="button" href="@item.Url" target="@item.Target">Explore</a> }
Did you solve the issue? Share with our community, please )
Thanks,
Alex
Hi Alex,
Yeah sure. For a single url you need to use <Link> instead of <MultiUrls>
<Link>
<MultiUrls>
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @using RJP.MultiUrlPicker.Models; @{ var button = Model.Content.GetPropertyValue<Link>("gridButton"); } @if(button != null) { <a class="button" href="@button.Url" target="@button.Target">@button.Name</a> }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Multi Url Picker + Doc Type Grid Editor
Hi All,
Im having an issue with my partial view for a button. I had created a button using the Multi URL Picker & Doc Type Grid Editor.
I have previously got it working, but the code has issues now that packages have been updated.
Im getting the error:
System.NullReferenceException: Object reference not set to an instance of an object.
Im using Umbraco 7.7.2, Multi Url Picker 2.0.1, DTGE 0.4.0.
Any help would be appreciated.
Martin.
Hi Martin
Are Property Value Converters enabled?
If yes, this code should work:
Hi Martin
Did you solve the issue? Share with our community, please )
Thanks,
Alex
Hi Alex,
Yeah sure. For a single url you need to use
<Link>
instead of<MultiUrls>
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.