1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Cannot save control properties

Cannot save control properties

2 posts, 0 answered
  1. Matt
    Matt avatar
    20 posts
    Registered:
    17 Oct 2008
    14 Apr 2009
    Link to this post
    Relates to 3.5 SP1

    I have created a custom control,
    something like ..

    [ToolboxItem(typeof(CurveBox))]  
    [DefaultProperty("HeaderText")]  
    [ParseChildren(false), PersistChildren(true)]  
    public class CurveBox : GenericContent  
    {  
        public CurveBox()  
        {}  
     
       private string _headerText;  
       [Category("CurveBox")]  
       public string HeaderText  
       {  
          get { return _headerText; }  
          set { _headerText = value; }  
       }  
     
     
       private HeaderContainerTag _headerContainer = HeaderContainerTag.H2;  
       [Category("CurveBox")]  
       public HeaderContainerTag HeaderContainer  
       {  
          get { return _headerContainer; }  
          set { _headerContainer = value; }  
       }  
     
        public enum HeaderContainerTag  
        {  
           None,  
           H1,  
           H2,  
           H3  
         }  


    I am having great difficulty saving the control properties when editing the control in sitefinity, I have managed it once or twice, I not sure exactly how, but 19 times out of 20 when I try and edit the control properties, it doesn't switch tab properly in the property editor, and any changes made to the control properties are not saved. It seems to be down to the failure to change tab correctly, then the control editor is not handling the update of the control props. I've spent a day trying various different incarnations of simple controls but to no avail.

    I have a working module based control and can edit the properties of that no problem, I'm not sure if I've tried to edit the properties on any of my other custom controls previously though.
  2. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    16 Apr 2009
    Link to this post
    Hello Matt,

    The very first thing I noticed and that will cause trouble is the ToolboxItemAttribute. You have to point to a ToolboxItem successor, which in turn will return the type of your class. It will result in being unable to upload the control through the UI in page editor. Uploading through web.config manually won't be an issue.

    We have KB article that relates to this problem. Although written for 3.6 hotfix, I believe it should work for 3.5 as well. You have to load templates the old-fashioned way (and probably use GenericContainer<T> instead of GenericContainer).

    If you have problems, please let us know.

    All the best,
    Dido
    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.
2 posts, 0 answered