More in this section

Forums / Developing with Sitefinity / Making the UserControl Public Properties User-friendly

Making the UserControl Public Properties User-friendly

3 posts, 1 answered
  1. kalyan bandi
    kalyan bandi avatar
    2 posts
    Registered:
    30 Jun 2009
    30 Jun 2009
    Link to this post
    Hi All,

    Please suggest me in the right direction for my problem. I have a user control and three public properties in it. The issue is, these three properties are urls of 3 images in the control. I need to give an option for the client to change the images.
    If i just take them as public properties, then there will be 3 textboxes for the urls. I need a Image/file select option for these properties. I tried with some thing like this, but its of no use. I think i am missing something here.

    [Telerik.Cms.Web.UI.WebEditor("Telerik.Cms.Web.UI.FileSelector, Telerik.Cms.Web.UI")]
        public string ImageFile1
        {
            get;
            set;
        }
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Jun 2009
    Link to this post
    Hi kalyan bandi,

    You need to use the web editor below:

     [WebEditor("Telerik.Libraries.WebControls.ImageSelector, Telerik.Libraries")] 
     
        public string SelectImage 
        { 
            get{return this.image; } 
            setthis.image = value; } 
        } 
     
        private string image; 

    It will return a Guid of a selected image that you can use. The dialog that will open has " Files" tab, so that you will be able to select images from your file system.


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  3. kalyan bandi
    kalyan bandi avatar
    2 posts
    Registered:
    30 Jun 2009
    30 Jun 2009
    Link to this post
    Thanks Ivan
    It worked.
Register for webinar
3 posts, 1 answered