More in this section

Forums / General Discussions / Render html controls in custom control template

Render html controls in custom control template

2 posts, 0 answered
  1. Alex
    Alex avatar
    13 posts
    23 Sep 2010
    07 Feb 2011
    Link to this post
    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?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    10 Feb 2011
    Link to this post
    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.

    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
2 posts, 0 answered