Umbraco/Samples and Articles/Dot Net Controls/Access Umbraco Data With Dot NET Controls

From Wikibooks, open books for an open world
< Umbraco‎ | Samples and Articles‎ | Dot Net Controls
Jump to: navigation, search

Access Umbraco Data with .NET controls[edit]

This is based on an original article at http://www.umbraco.org/frontpage/documentation/implementingnetcontrols/accessingumbracodata.aspx

Getting Started[edit]

You can access all umbraco content by creating a reference to the umbraco.dll. Use the node factory located at umbraco.presentation.nodeFactory to mainpulate the XML used to store all of Umbracos data.

First include:

using umbraco.presentation.nodeFactory;

To get the current node for the page the control is on use the Node.GetCurrent() method:

Node curNode = Node.GetCurrent();

Using your newly created node object, you can use work on the current node directly, or use it as a starting point to traverse the entire tree.