Render html controls in custom control template
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
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