More in this section

Forums / Developing with Sitefinity / How to pass data to a designer template

How to pass data to a designer template

3 posts, 1 answered
  1. Jeff
    Jeff avatar
    6 posts
    Registered:
    30 Nov 2011
    13 Dec 2011
    Link to this post
    Hi Guys, 
    I'm pretty new to Sitefinity so there may be something I'm not understanding about how data is handled, but I am attempting to create a custom menu for our website.  I would like to create a dropdown menu similar to the navigation control that ships with Sitefinity.  I want to be able to select 'a custom selection of pages' for this menu, and I'm trying to create a designer with this functionality. I followed this tutorial to create a simple control with designer: http://www.sitefinity.com/40/help/developers-guide/how-to-how-to-create-a-date-picker-control-creating-the-control-designer.html
     The problem is that the designer template doesn't have a codebehind, so I'm not sure how to populate a list of top level sitemap items, nor how information gets saved to the database. I'm thinking ajax might be my friend here, but can I run controls outside of the Sitefinity model? What is the correct way to approach this? Thank you very much for your time, 
    -Jeff Lauder
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    13 Dec 2011
    Link to this post
    Hi Jeff,
    It is actually possible to use a full user-control as a designer template. In fact, I do exactly that in this example: Creating Advanced Sitefinity 4 Widget Control Designers

    Using this approach you should be able to bind the items you need on the server side for use in the widget template.

    I hope this is helpful!
    Answered
  3. Jeff
    Jeff avatar
    6 posts
    Registered:
    30 Nov 2011
    13 Dec 2011
    Link to this post
    That is a fantastic post! Thank you very much.
3 posts, 1 answered