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

Forums / Developing with Sitefinity / Including a Sitefinity form in a custom control

Including a Sitefinity form in a custom control

6 posts, 1 answered
  1. David
    David avatar
    38 posts
    Registered:
    05 Apr 2012
    17 Aug 2012
    Link to this post
    Hi

    I am trying to build a custom control that shows a list of competitions, along with their details, an application form and then a thank you page.

    My custom control consists of a mutliview control with the 4 pages as views inside it.

    Ideally, when the CMS user creates a competition, they will be able to point at a previously created Sitefinity form somehow, and then this gets rendered by my control, and functions like the form would on a normal page, saving the data away and then redirecting to a thank you URL that would be set dynamically.

    Is this even possible, if not any suggestions on how I could fake it or do it another way?

    This is my first project with Sitefinity, so if any of the veteran users can suggest a better way rather than using one usercontrol with a multiview, I am open to suggestions.

    Regards,
    David
  2. Mike
    Mike avatar
    11 posts
    Registered:
    03 May 2012
    21 Aug 2012
    Link to this post
    Cheeky bump of this post to see if anyone has any thoughts please!
  3. Mike
    Mike avatar
    11 posts
    Registered:
    03 May 2012
    21 Aug 2012
    Link to this post
    Possible solution mentioned by Sitefinity support here
    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/how-to-get-form-control-ordinal-position-on-page.aspx

    However it refers to RenderFormFields() in Telerik.Sitefinity.Modules.Forms.Web.UI.FormsControl, which I can't find anywhere.

    Can anyone help?

    Andy
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    22 Aug 2012
    Link to this post
    I cant see why this wouldn't work...

    Go to the settings toolbox (in advanced) and get the type of control the forms control uses.  Then use JustDecompile to find out the properties of the control, it probably accepts the Guid of the form to render.

    Then just link it in like any other control with the prefix and controlname
    Answered
  5. David
    David avatar
    38 posts
    Registered:
    05 Apr 2012
    22 Aug 2012
    Link to this post
    Hi Steve

    Thanks to your post, while not the exact solution, led me to the solution that works for me, of which is posted below for posterity.

    In the custom user control regsiter the assembly "Telerik.Sitefinity" and the namespace is "Telerik.Sitefinity.Modules.Forms.Web.UI". 

    This gives you access to the FormsControl control which does all the forms bits you would expect, including a Guid FormId property.

    Thanks,
    David
  6. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    22 Aug 2012
    Link to this post
    Yeah sorry, typed it on my ipad, didn't have JD with me to dig in deeper :)
6 posts, 1 answered