title: Get umbraco property with inline C#
body: <p>I'm trying to show content in my masterpage depending on a true/false property on my document type. I'm using inline C# and i got this far:</p>
  
  <pre><code>&lt;% if (umbraco.library.IsLoggedOn() &amp;&amp; umbraco.library.GetXmlNodeById("0").GetProperty("protectContent").Value.ToString() == "1") {%&gt; 
  &lt;h1&gt;Logged on and showing protected content&lt;/h1&gt;
  &lt;%}%&gt;
  </code></pre>
  
  <p>This is the error message i get:</p>
  
  <blockquote>
    <p>Compiler Error Message: CS1061: 'System.Xml.XPath.XPathNodeIterator' does not contain a definition for 'GetProperty' and no extension method 'GetProperty' accepting a first argument of type 'System.Xml.XPath.XPathNodeIterator' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Final solution:
  Based on Digbyswifts solution i got it working with this snippet:</p>
  
  <pre><code>&lt;%if (umbraco.NodeFactory.Node.GetCurrent().GetProperty("protectContent").Value.ToString().Equals("1")) {%&gt; 
      &lt;pre&gt;Showing protected content&lt;/pre&gt;
  &lt;%}%&gt;
  </code></pre>