I'm working on a project using Umbraco 6 and WebForms.
In Content, there are Employees. So umbraco.config contains these lines:
<Employee id="15853" ...>
<email>xxx</email>
</Employee
>
In C#, how do I get the Employee node having email=xxx? I tried this:
Node nodeEmail = Node.GetNodeByXpath("//Member/email[text()='xxx']");
and it throws this exception:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.NodeFactory.Node.initialize() +172
umbraco.NodeFactory.Node..ctor(XmlNode NodeXmlNode) +179
umbraco.NodeFactory.Node.GetNodeByXpath(String xpath) +168
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/65248-getnodebyxpath-throws-nullreferenceexception