Render html controls in custom control template

Posted by Community Admin on 03-Aug-2018 14:29

Render html controls in custom control template

All Replies

Posted by Community Admin on 07-Feb-2011 00:00

Hi guys,


I have a custom control built according to your tutorial.
What I want to do is built some sort of general custom control that does the following:

Let's say the UserControlTest.ascx.cs has some properties for example:

DisplayHTML- bool
Link- string
and so forth

which I want to transform for the bool in a checkbox, and for the string in a textbox(with an option to browse within sitefinity for a page) and so forth

The UserControlDesignerTemplate.ascx has no idea about this properties, and hasn't yet the html controls for this because it doesn't know what to expect from each separate page.

My question is if there is any way, to send some sort of array containing the properties from UserControlTest.ascx.cs to the template to create them , or what would you suggest as an implementation to this kind of generic user  custom control in sitefinity?

Regards,
Alex

Posted by Community Admin on 10-Feb-2011 00:00

Hello Alex,

Thank you for contacting Telerik Support.

Once you mark your control with the ControlDesigner attribute and create a control designer for your control by following the example in this blog post your control designer will automatically get public properties of your control and send it to the client side component represented by your control designer. Once you have done this you can access public properties by using this.get_controlData().PropertyName.

Regards,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed