Create Sitefinity Form programmatically

Posted by Community Admin on 04-Aug-2018 16:03

Create Sitefinity Form programmatically

All Replies

Posted by Community Admin on 30-Sep-2015 00:00

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? 

Posted by Community Admin on 02-Oct-2015 00:00
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());

The code executes if a form with a matching id does not already exist.

Regards,
Nader Dabour
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 
This thread is closed