doh, sorry Barry... did not notice you SPECIFICALLY wanted the nodeName -- i so rarely use that property for anything... i just treated it as an example of trying to access a property via nodefactory...
gotta say, i am lovin learning more about the .net aspect of umbraco outside of just xslt macros :P
Getting NodeName
How do you get the nodename or other properties for the current node.
I have this
Node EventNode = Node.GetCurrent();
EventName = EventNode.GetProperty("NodeName").Value;
But it causes an error
whoohoo... i think i can answer another .net question -- this is so fun :)
be sure to include nodeFactory... and make sure you are specifying a the String... worked for me last night.
using umbraco.presentation.nodeFactory;
Node myNode = Node.GetCurrent();
String myValue = myNode.GetProperty("congratsEmail").Value;
The problem was.. you get the nodename like this..
Node EventNode = Node.GetCurrent();
EventName = EventNode.Name;
int id = umbraco.presentation.nodeFactory.Node.GetCurrent().Id;
Document d = new Document(id);
string nodeName = d.Text;
doh, sorry Barry... did not notice you SPECIFICALLY wanted the nodeName -- i so rarely use that property for anything... i just treated it as an example of trying to access a property via nodefactory...
gotta say, i am lovin learning more about the .net aspect of umbraco outside of just xslt macros :P
Thank you skiltz, Document.Text is the same as getting the nodeName value!
:)
is working on a reply...