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. I have a simple question. I want to make a link from one Umbraco page to another. If the node id is, say "1234", how do I write this link in a view? //Lars
Hi Lars!
I always use
@{ var url = Umbraco.TypedContent(1234).Url } <a href="@url">link</a>
Br
Stefano
Hi Lars,
You can use the .NiceUrl helper method. So you can do something like this
<a href="@Umbraco.NiceUrl(1234)">My link</a>
You can find the documentation of the .NiceUrl here https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/ and there is also one that includes the domain.
Just search for NiceUrl on the page.
Hope this helps,
/Dennis
Thank you both for a fine and quick answer. I tried the niceurl and it works. Misson completed :-)
//Lars
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Razor: Getting the url from a node ID in razor (view)
Hi. I have a simple question. I want to make a link from one Umbraco page to another. If the node id is, say "1234", how do I write this link in a view? //Lars
Hi Lars!
I always use
Br
Stefano
Hi Lars,
You can use the .NiceUrl helper method. So you can do something like this
You can find the documentation of the .NiceUrl here https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/ and there is also one that includes the domain.
Just search for NiceUrl on the page.
Hope this helps,
/Dennis
Thank you both for a fine and quick answer. I tried the niceurl and it works. Misson completed :-)
//Lars
is working on a reply...