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
Is this an acceptable way to get an url for a page, or is there a better way?
<a href="@Umbraco.NiceUrl(@fieldset.GetValue("link").AsInt())"> click</a>
Yes, perhaps a slight tweak:
<a href="@Umbraco.NiceUrl(fieldset.GetValue<int>("link"))">click</a>
Nice!
So what if i'm inside an ipublished context?
@Umbraco.NiceUrl(@boxItem.GetProperty<int>("link").Value)or@Umbraco.NiceUrl(@boxItem.GetProperty("link").Value.AsInt())
Doesnt really work...
@boxItem.GetProperty("link").Value
Gives me the id correctly, but as a string i guess.
Simply:
@Umbraco.NiceUrl(boxItem.GetPropertyValue<int>("link"))
Should always use GetPropertyValue rather than GetProperty in Razor rendering
Holy s... that was fast. And precise, and clean :)
Thanks!
np :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
get url from node ID
Is this an acceptable way to get an url for a page, or is there a better way?
Yes, perhaps a slight tweak:
Nice!
So what if i'm inside an ipublished context?
Doesnt really work...
Gives me the id correctly, but as a string i guess.
Simply:
Should always use GetPropertyValue rather than GetProperty in Razor rendering
Holy s... that was fast. And precise, and clean :)
Thanks!
np :)
is working on a reply...