More in this section

Forums / Developing with Sitefinity / Custom User Control Properties

Custom User Control Properties

2 posts, 0 answered
  1. David
    David avatar
    50 posts
    14 Jan 2009
    01 Jul 2010
    Link to this post

    I have a user control which is used many different places throughout the website. It is a contact form which has a number of different settings that change the fields that are displayed. Although they are different, the form is always submitted to the same e-mail address.

    The client has requested that the e-mail address be modifiable through Sitefinity, but when they change it for one of the instances of the user control, it should change for all of them. I currently have it exposed as a property in Sitefinity, but I have to change the value on each page that it is used. Is it possible to code it so that I only have to change it one place in Sitefinity, and it will trickle down to all instances of this user control?

    Thank you for your support,
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    02 Jul 2010
    Link to this post
    Hello David,

    Thank you for contacting Telerik Support.

    You should do this in the setter for your control property:
    public string MyProperty
            //your code for get
            this.myProperty = value;
            //add the logic for updating all property values

    You can open a connection to your database and query the sf_CmsControlProperty table for results where the [Name] column is equal to your property name. Then for all the results in the data set update the [Value] column with the new value.

    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