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,
I'm started using Umbraco 6 today and I was wondering how I could get the current node in my .NET-codefile. I used to do it (in Umbraco 4) like
Node nThisNode = Node.GetCurrent();
but I was wondering if this is still the correct way, because the introduction of the ContentService in V6.
Hope somebody can help me out,
Jeffrey
The ContentService is for creating new content. Not fetching existing content. You can use IPublishedContent for that: http://our.umbraco.org/documentation/Reference/Mvc/querying
Jeroen
Here is some more info about getting the current node: http://issues.umbraco.org/issue/U4-1528
Hi Jeroen,
thanks for the quick feedback! But how would I do this in WebForms syntax (instead of MVC)?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
GetCurrentNode in Umbraco 6
Hi all,
I'm started using Umbraco 6 today and I was wondering how I could get the current node in my .NET-codefile. I used to do it (in Umbraco 4) like
but I was wondering if this is still the correct way, because the introduction of the ContentService in V6.
Hope somebody can help me out,
Jeffrey
The ContentService is for creating new content. Not fetching existing content. You can use IPublishedContent for that: http://our.umbraco.org/documentation/Reference/Mvc/querying
Jeroen
Here is some more info about getting the current node: http://issues.umbraco.org/issue/U4-1528
Jeroen
Hi Jeroen,
thanks for the quick feedback! But how would I do this in WebForms syntax (instead of MVC)?
is working on a reply...