[CLOSED] Runtime error in abstract component .cs

  1. #1

    [CLOSED] Runtime error in abstract component .cs

    Hello

    when running my application I have this error :

    "Ext.Net.Toolbar cannot use content"


    on the line
    return this.ContentContainer.ClientID;

    in this function
             /// <summary>
            /// The id of an existing HTML node to use as the panel's body content (defaults to '').
            /// </summary>
            [ConfigOption]
            [Category("3. AbstractComponent")]
            [DeferredRender]
            [DefaultValue("")]
            [Description("The id of an existing HTML node to use as the panel's body content (defaults to '').")]
            public virtual string ContentEl
            {
                get
                {
                    if (!this.DesignMode)
                    {
                        if (this.PreventContent)
                        {
                            return "";
                        }
    
                        if (!this.ContentContainer.Visible)
                        {
                            return "";
                        }
    
                        if (this.Content == null && this.ContentControls.Count == 0)
                        {
                            this.ContentContainer.Visible = false;
                            return "";
                        }
    
                        this.ContentContainer.Visible = true;
    
                        var container = this as AbstractContainer;
                        if (container != null && this.ContentControls.Count > 0 && container.Items.Count == 0 && container.Layout.IsNotEmpty())
                        {
                            return "";
                        }                    
                    }
    
                    if (this is INoneContentable)
                    {
                        throw new Exception(this.GetType().ToString() + " cannot use Content");
                    }
    
                    return this.ContentContainer.ClientID;
                }
            }
    Last edited by Daniil; Apr 18, 2012 at 12:01 PM. Reason: [CLOSED]
  2. #2
    Hi,

    It means that you cannot use Toolbar Content like this:
    <ext:Toolbar runat="server">
        <Content>
            <ext:DisplayField runat="server" Html="Hello World!" />
        </Content>
    </ext:Toolbar>
    Please use Items.
  3. #3
    OK, thanks, I will change content by items.

    Could you give more explanation about that point just to understand what happened? And for other controls where I could use content in place of items, it will be the same behavior?
  4. #4
    Well, Toolbar doesn't support Content due to its destination. It should contain only Ext.Net.Components.

    You can still use Content of Container, Panel, Window.
  5. #5
    Thanks a lot.

    At least I have a squeleton of my application that run now. I have the desktop but no items in start menu...I have to go deeper to see what happened.

Similar Threads

  1. Replies: 2
    Last Post: May 08, 2012, 3:34 PM
  2. [CLOSED] [1.0] combo addEvents runtime error - BUG?
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 04, 2010, 10:42 AM
  3. runtime error in VS 2008
    By BLOZZY in forum 1.x Help
    Replies: 4
    Last Post: Apr 07, 2009, 4:58 AM
  4. A Runtime Error has occurred
    By mono in forum 1.x Help
    Replies: 1
    Last Post: Mar 11, 2009, 8:31 AM
  5. [CLOSED] DateField error at runtime
    By methode in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 24, 2008, 1:11 PM

Posting Permissions