Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an Umbraco Content Node with .net User Control?

i have a .net user control to add some opinions nodes to umbraco content tree.In umbraco i have a Opinion document type and content page.I need to show this usercontrol in the page,until there i can do it,but i have to add an "Opinion Node" to umbraco content tree.How can i do that ? There is no any document for this,ive been searching it for 2 days.Thanks in advance

like image 969
Erdem Gundogdu Avatar asked Jan 17 '23 10:01

Erdem Gundogdu


1 Answers

Document d = Document.MakeNew("New node name", DocumentType.GetByAlias("myDoctype"), User.GetCurrent(), parentNodeId);

Replace the parameters with appropriate values to create a new node called "New node name" of type "MyDoctype". If doing this through front-end (public-accessible) code, use the admin user by replacing User.GetCurrent() with new User(-1).

like image 72
Jamie Howarth Avatar answered Feb 08 '23 11:02

Jamie Howarth