I belive Mikael is correct here. This cannot be set after the node has already been created using a particular nodeTypeAlias. I can't say that I have tried it, but I am fairly certain this is the case.
When a page is created from a specific doc. type all the properties of that doc. type is put in the database with the values given to them on the page.
If you then try to change the doc. type to another one, what should happen to all the properties from the original doc. type ? and how should the properties of the new doc. type be populated ?
One way to acomplish the same would be to delete the original page and ad a new page with the same name, but a new doc. type. But you would still need to populate the new doc. types properties in some way.
convertion
how to assign documentObject.ContentType.Alias to documentObject.Parent.
i am getting conversion error:
Error 1 Cannot implicitly convert type 'string' to 'umbraco.cms.businesslogic.CMSNode'
documentObject.Parent is in fact a node, to get its alias you can try something like documentObject.Parent.getProperty("nodeTypeAlias").Value
i want set value to documentObject.parent
Is it possible to change the NodeTYpe after a node is created ?
I thought that was a no go ??
Mikael
I belive Mikael is correct here. This cannot be set after the node has already been created using a particular nodeTypeAlias. I can't say that I have tried it, but I am fairly certain this is the case.
It makes sense too.
When a page is created from a specific doc. type all the properties of that doc. type is put in the database with the values given to them on the page.
If you then try to change the doc. type to another one, what should happen to all the properties from the original doc. type ? and how should the properties of the new doc. type be populated ?
One way to acomplish the same would be to delete the original page and ad a new page with the same name, but a new doc. type. But you would still need to populate the new doc. types properties in some way.
Mikael
is working on a reply...