Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys!
I'm having troubles creating a Document/Node via Umbraco 6.1.6 API I'm currently using User Controls in a Web Forms project, and this is the code im using:
DocumentType dt = DocumentType.GetByAlias("uBlogsyComment");
User author = User.GetUser(0);
Document doc = Document.MakeNew("My new document", dt, author,
if(toPublish) doc.Publish(author);
Would love to get some help with it
tnx!
I am using the content service to create new documents. Hope this helps you:
var contentService = ApplicationContext.Current.Services.ContentService; var newDoc = contentService.CreateContent("YourNewNodeName", yourParentDocument, "YourContentType"); newDoc.setValue("yourField1", "yourValue1"); newDoc.setValue("yourField2", "yourValue2"); contentService.SaveAndPublish(newDoc);
Read more here: http://umbraco.com/follow-us/blog-archive/2013/1/22/introducing-contentservice-aka-the-v6-api.aspx/
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Creating a Document/Node in Web Forms User Controls Umbraco 6.1.6 API
Hi guys!
I'm having troubles creating a Document/Node via Umbraco 6.1.6 API I'm currently using User Controls in a Web Forms project, and this is the code im using:
DocumentType dt = DocumentType.GetByAlias("uBlogsyComment");
User author = User.GetUser(0);
Document doc = Document.MakeNew("My new document", dt, author,
if(toPublish) doc.Publish(author);
Would love to get some help with it
tnx!
I am using the content service to create new documents. Hope this helps you:
Read more here: http://umbraco.com/follow-us/blog-archive/2013/1/22/introducing-contentservice-aka-the-v6-api.aspx/
is working on a reply...