Create Sitefinity Form programmatically
I want to create a Sitefinity form programmatically. My question is in reference to this documentation: docs.sitefinity.com/for-developers-create-forms
It says "Create a form in Sitefinity backend by pasting the following code"
I am not sure exactly how to go about this.
I can call the code from anywhere I suppose in my application, but the call to CreateContactForm has a GUID parameter. Since the form doesn't exist yet, do I simply create a new GUID and pass that in?
Hello,
As you pointed out you can place the code from the documentation article anywhere in your application.
For example you can create a user widget and register it inside Sitefinity:
http://docs.sitefinity.com/for-developers-create-a-new-user-widget
http://docs.sitefinity.com/register-a-new-widget-in-the-backend
To call the CreateContactForm method just pass a new Guid object the following way:
CreateContactForm(Guid.NewGuid());