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 was just wondering how do you get the current node in a cs file in umbraco like you used to with Node GetCurrent
Cheers,
Tom
Hi Tom,
You should extend your class with the UmbracoUserControl then you can access the AssignedContentItem object on the Umbraco Helper
e.g.
namespace MyNameSpace { public class MyControl : UmbracoUserControl { protected void Page_Load(object sender, EventArgs e) { var currentId = Umbraco.AssignedContentItem.Id; } } }
Thanks,
Jeavon
You could also try:
var currentNode = UmbracoContext.Current.PublishedContentRequest.PublishedContent
Jeroen
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
v6 Get Current Page in CodeBehind i.e. a user control .cs
Hi I was just wondering how do you get the current node in a cs file in umbraco like you used to with Node GetCurrent
Cheers,
Tom
Hi Tom,
You should extend your class with the UmbracoUserControl then you can access the AssignedContentItem object on the Umbraco Helper
e.g.
Thanks,
Jeavon
You could also try:
Jeroen
is working on a reply...