+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Create Sitefinity Form programmatically

Create Sitefinity Form programmatically

2 posts, 0 answered
  1. Chip
    Chip avatar
    14 posts
    Registered:
    25 Nov 2013
    30 Sep 2015
    Link to this post

    I want to create a Sitefinity form programmatically. My question is in reference to this documentation: http://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? 

  2. Nader Dabour
    Nader Dabour avatar
    12 posts
    Registered:
    06 Dec 2016
    02 Oct 2015
    Link to this post
    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
     
2 posts, 0 answered