I tried retrieve tree node of current page using SelectSingleNode but i got a error "Object reference not set to an instance of an object".I tried hard code a node Id of other page and it is not null.
var tr = new TreeProvider();
TreeNode tn = tr.SelectSingleNode(CMSContext.CurrentDocument.DocumentID);
Please help me!
You need to use CMSContext.CurrentDocument.NodeID
I changed DocumentID by NodeID and it work correct!
Please, sign in to be able to submit a new answer.