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
    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:

    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
    01 Jun 2017
    02 Oct 2015
    Link to this post

    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:

    To call the CreateContactForm method just pass a new Guid object the following way:

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

    Nader Dabour
    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