How do i update an Umbraco Node's property value from the code behind?
Hello,
I've been stuck on this for a day now.
How can i update a Node's property from the code behind for ASP.Net?
All the umbraco.library.NodeFactory.Node methods are Get's, none seem to set a property value.
I
tried to update the value in the database directly which seems to work,
but because i dont know how to publish the content from my code behind
the vlaue gets ignored.
When i use the above it changes the value in umbraco which is cool but it doesnt publish the item so the value on the site does not change. Should i use doc.Publish after doc.Save?
If so it asks for a user, what user should i pass in?
How do i update an Umbraco Node's property value from the code behind?
Hello,
I've been stuck on this for a day now.
How can i update a Node's property from the code behind for ASP.Net?
All the umbraco.library.NodeFactory.Node methods are Get's, none seem to set a property value.
I tried to update the value in the database directly which seems to work, but because i dont know how to publish the content from my code behind the vlaue gets ignored.
Any help will be greatly appreciated!
Many thanks
Mike
Hi,
nodeFactory.Node is for published xml only, so it's always readonly. if you need to update a doc's property, use
Cheers,
/Dirk
Thanks dirk thats a big help.
When i use the above it changes the value in umbraco which is cool but it doesnt publish the item so the value on the site does not change. Should i use doc.Publish after doc.Save?
If so it asks for a user, what user should i pass in?
Thanks,
Mike
Hey Mike,
Code sample at this link http://our.umbraco.org/wiki/reference/api-cheatsheet/modifying-document-properties
Rich
Rich that is exactly what i've been searching for! Many thanks that works fine. Thanks guys.
Hey Mike,
Glad you got it working, if you can mark a post as a 'Solution' then it can help others looking for the same info.
Cheers
Rich
Hi,
btw, if you have uComponents installed, you can also use uQuery methods to set property values:
HTH,
Hendy
is working on a reply...