How to pass data to a designer template

Posted by Community Admin on 04-Aug-2018 17:18

How to pass data to a designer template

All Replies

Posted by Community Admin on 13-Dec-2011 00:00

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

Posted by Community Admin on 13-Dec-2011 00:00

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!

Posted by Community Admin on 13-Dec-2011 00:00

That is a fantastic post! Thank you very much.

This thread is closed