Sorry if this has been asked a hundred times, but while I dig through several years old posts, I am hoping someone can jump in with the answer.
We used to use the Doc2Form package in Umbraco 4.x which would allow a visitor to the website to fill out a form and have the data automatically create a content node. Doc2Form was never updated for Umbraco 6.
I currently have a c# .Net usercontrol that is a simple suggestion box form. It gathers a few text fields, saves them to a database and sends and email. I now need to extend it to automatically create an Umbraco document. I know it can be done, but what is the current recommended way? Can I do this via a usercontrol or must I change it to something else?
How to create content via C# Usercontrol
Sorry if this has been asked a hundred times, but while I dig through several years old posts, I am hoping someone can jump in with the answer.
We used to use the Doc2Form package in Umbraco 4.x which would allow a visitor to the website to fill out a form and have the data automatically create a content node. Doc2Form was never updated for Umbraco 6.
I currently have a c# .Net usercontrol that is a simple suggestion box form. It gathers a few text fields, saves them to a database and sends and email. I now need to extend it to automatically create an Umbraco document. I know it can be done, but what is the current recommended way? Can I do this via a usercontrol or must I change it to something else?
Hi Connie,
You can create content with ContentService since 6 version was introduced.
Read more about ContentService - https://our.umbraco.org/documentation/reference/management/services/contentservice
Example:
Thanks,
Alex
Thank you! Kept finding docs for older or newer versions. I got it working well pretty easily. Now just have to deal with a couple issues.
How to specify the parentId without having to hard code the value. How to get the userId for the currently logged in user.
Time to Google!
is working on a reply...