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

Forums / Developing with Sitefinity / Problem..inherit GenericContent

Problem..inherit GenericContent

3 posts, 0 answered
  1. Bachar Zeidan
    Bachar Zeidan avatar
    67 posts
    Registered:
    01 Jul 2010
    07 Sep 2010
    Link to this post
    Hello  Everybody
    I had a problem inheriting the GenericContent Class
    this is My code:
    Namespace Telerik.Cms.Engine.WebControls
      
        Public Class R3GenericContent
            Inherits GenericContent
      
            Private _NomeDiv As String
      
      
      
            <ComponentModel.Bindable(False), Category("Customize"), DefaultValue(""), _
           Description("Inserire il Nome della classe del div")> _
            Public Property NomeDelDiv() As String
      
      
                Get
                    Return _NomeDiv
                End Get
      
                Set(ByVal value As String)
                    _NomeDiv = value
                End Set
            End Property
      
      
      
            Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
                MyBase.OnLoad(e)
            End Sub
      
      
      
      
      
        End Class
      
      
    End Namespace

    and in my web.conf
    <add name="Custom Generic Content" section="Most popular" type="Telerik.Cms.Engine.WebControls.R3GenericContent, App_Code" description="Generic COntent Personalizato" />

    Now in my code Behind i can see my custom control ("Custom Generic Content") in  my Most popular section but when i drop the control inside a page , my custom control results as GenericContent and Not Custom Generic Content, even in the Control properties i can not see my custom Property  "NomeDelDiv"....
    it seams like a Sitefinity Generic Content and not my Custom COntrol
    did i missed something
    another question: if this is the right way to inherit the GenericContent class?

    thank you
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    07 Sep 2010
    Link to this post
    Hi Bachar Zeidan,

    You have to create  Toolboxitem for your control

    sample

    public class GenericContentToolboxItemCustom : ToolboxItem
    {
        public GenericContentToolboxItemCustom()
            : base(typeof(GenericContentHelpControl))
        {
            base.DisplayName = "GenericContentCustomControl";
            base.Description = "GenericContentCustomControl for online help";
        }
    }


    Best wishes,
    Ivan Dimitrov
    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
  3. Bachar Zeidan
    Bachar Zeidan avatar
    67 posts
    Registered:
    01 Jul 2010
    07 Sep 2010
    Link to this post
    thx you very much!
Register for webinar
3 posts, 0 answered