You find the nodeid in Umbraco backoffice by either looking at a specific document in the "properties" tab - Here you can see the ID.
You can also just hold your mouse over a specific node and look in the lower left corner. Here you'll also see the ID of the node.
But it's never a good idea to use hardcoded ID's in the code so I think you should be able to access the ID of the current node the macro is being used on by writing something like this:
Node node = Node.GetCurrent().id; This should give you the id of the current node, so you can then pass the "node" to the
Document doc = new Document(node);
Does this make sense to you? (I'm not that skilled at C# :))
Read Textbox datatype value in usercontrol
Hi There,
I have created a Textbox datatype called "EmailAddressContact "
now I want to read EmailAddressContact .Text in my UserControl code.
Your help is greatly appreciated
Regards
Sword
Hi praveen
I think you might find this helpfull then: http://our.umbraco.org/wiki/reference/api-cheatsheet/modifying-document-properties
Here you can also see how to create new nodes using the API etc.
Hope this helps.
/Jan
Hi Jan
Many thanks for the reply and the solution
can you please tell me how do I get the document id (1029)
Document doc = new Document(1029);
I think i need to do the follwing to read value of the document property
string emailtext = doc.getProperty("EmailAddressContact ").Value ;
Please let me know, and many thanks for your help.
Kind Regards
Hi praveen
You find the nodeid in Umbraco backoffice by either looking at a specific document in the "properties" tab - Here you can see the ID.
You can also just hold your mouse over a specific node and look in the lower left corner. Here you'll also see the ID of the node.
But it's never a good idea to use hardcoded ID's in the code so I think you should be able to access the ID of the current node the macro is being used on by writing something like this:
Node node = Node.GetCurrent().id; This should give you the id of the current node, so you can then pass the "node" to the
Document doc = new Document(node);
Does this make sense to you? (I'm not that skilled at C# :))
/Jan
Is this resolved? Did you able to use the value of your custom doctype? I need to do similar stuff so...
is working on a reply...