Hi All. I am using Umbraco 4.0.2.1. Currently I am developing a.Net user control and a document ID will be passed to it. So how can I retrieve all its properties by using its id? I know xslt can do this but do not know how user control do it?
You can use the umbraco.presentation.nodeFactory.Node class for this. You can use umbraco.presentation.nodeFactory.Node.GetCurrent() to get the current node or new umbraco.presentation.nodeFactory.Node(nodeId) to get a specific node.
On the node you can access the property using node.GetProperty(propertyAlias). or all properties via node.Properties
How can user control retreive document property
Hi All. I am using Umbraco 4.0.2.1. Currently I am developing a.Net user control and a document ID will be passed to it. So how can I retrieve all its properties by using its id? I know xslt can do this but do not know how user control do it?
Thank you
Jing
Hi Jing,
You can use the umbraco.presentation.nodeFactory.Node class for this. You can use umbraco.presentation.nodeFactory.Node.GetCurrent() to get the current node or new umbraco.presentation.nodeFactory.Node(nodeId) to get a specific node.
On the node you can access the property using node.GetProperty(propertyAlias). or all properties via node.Properties
Hope this helps you,
Richard
thanks Richard. you solved my problem
is working on a reply...