Composite control problem

Discussion in 'ASP .Net' started by Mark Goldin, Aug 29, 2004.

  1. Mark Goldin

    Mark Goldin Guest

    I have created a Web composite control that consists of a label and
    Infragistics WebMaskEdit text box.
    When I drop that control on my form I have "Error Creating Control ..."
    thing.
    When I move a mouse over the control I see the following:
    "Could not load type CompositeControls.TextBoxLabel from assemply
    CompositeControls ..."
    Can somebody help, please?

    Here is source code:
    using System;

    using System.Web;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.ComponentModel;

    using Infragistics.WebUI.WebDataInput;

    namespace CompositeControls

    {

    // <summary>

    // Summary description for TexBoxLabel

    // </summary>

    [DefaultProperty("Text"),

    ToolboxData("<{0}:TexBoxLabel runat=server></{0}:TexBoxLabel>")]

    public class TextBoxLabel : System.Web.UI.WebControls.WebControl,
    INamingContainer

    {

    private Label label;

    private WebMaskEdit textBox;


    [Bindable(true), Category("Appearance"), DefaultValue("Label")]

    public string LabelText

    {

    get

    {

    EnsureChildControls();

    return label.Text;

    }

    set

    {

    EnsureChildControls();

    label.Text = value;

    }

    }


    [Bindable(true), Category("Appearance"), DefaultValue(" ")]

    public string Text

    {

    get

    {

    EnsureChildControls();

    return textBox.Text;

    }

    set

    {

    EnsureChildControls();

    textBox.Text = value;

    }

    }

    protected override void CreateChildControls()

    {

    label = new Label();

    label.Height = 20;

    label.Width = 60;

    label.Font.Size = 8;

    this.Controls.Add(label);

    textBox = new WebMaskEdit();

    this.Controls.Add(textBox);

    }

    }

    }
    Mark Goldin, Aug 29, 2004
    #1
    1. Advertising

  2. Mark Goldin

    Teemu Keiski Guest

    With quick glance, not sure why it fails in this case, but removing the
    ToolBoxData attribute completely seems to help. Removing it worked in my
    test.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke



    "Mark Goldin" <> wrote in message
    news:...
    > I have created a Web composite control that consists of a label and
    > Infragistics WebMaskEdit text box.
    > When I drop that control on my form I have "Error Creating Control ..."
    > thing.
    > When I move a mouse over the control I see the following:
    > "Could not load type CompositeControls.TextBoxLabel from assemply
    > CompositeControls ..."
    > Can somebody help, please?
    >
    > Here is source code:
    > using System;
    >
    > using System.Web;
    >
    > using System.Web.UI;
    >
    > using System.Web.UI.WebControls;
    >
    > using System.ComponentModel;
    >
    > using Infragistics.WebUI.WebDataInput;
    >
    > namespace CompositeControls
    >
    > {
    >
    > // <summary>
    >
    > // Summary description for TexBoxLabel
    >
    > // </summary>
    >
    > [DefaultProperty("Text"),
    >
    > ToolboxData("<{0}:TexBoxLabel runat=server></{0}:TexBoxLabel>")]
    >
    > public class TextBoxLabel : System.Web.UI.WebControls.WebControl,
    > INamingContainer
    >
    > {
    >
    > private Label label;
    >
    > private WebMaskEdit textBox;
    >
    >
    > [Bindable(true), Category("Appearance"), DefaultValue("Label")]
    >
    > public string LabelText
    >
    > {
    >
    > get
    >
    > {
    >
    > EnsureChildControls();
    >
    > return label.Text;
    >
    > }
    >
    > set
    >
    > {
    >
    > EnsureChildControls();
    >
    > label.Text = value;
    >
    > }
    >
    > }
    >
    >
    > [Bindable(true), Category("Appearance"), DefaultValue(" ")]
    >
    > public string Text
    >
    > {
    >
    > get
    >
    > {
    >
    > EnsureChildControls();
    >
    > return textBox.Text;
    >
    > }
    >
    > set
    >
    > {
    >
    > EnsureChildControls();
    >
    > textBox.Text = value;
    >
    > }
    >
    > }
    >
    > protected override void CreateChildControls()
    >
    > {
    >
    > label = new Label();
    >
    > label.Height = 20;
    >
    > label.Width = 60;
    >
    > label.Font.Size = 8;
    >
    > this.Controls.Add(label);
    >
    > textBox = new WebMaskEdit();
    >
    > this.Controls.Add(textBox);
    >
    > }
    >
    > }
    >
    > }
    >
    >
    >
    Teemu Keiski, Aug 29, 2004
    #2
    1. Advertising

  3. Mark Goldin

    Mark Goldin Guest

    Is it OK to use the contol without that attribute?
    "Teemu Keiski" <> wrote in message
    news:...
    > With quick glance, not sure why it fails in this case, but removing the
    > ToolBoxData attribute completely seems to help. Removing it worked in my
    > test.
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    > http://blogs.aspadvice.com/joteke
    >
    >
    >
    > "Mark Goldin" <> wrote in message
    > news:...
    > > I have created a Web composite control that consists of a label and
    > > Infragistics WebMaskEdit text box.
    > > When I drop that control on my form I have "Error Creating Control ..."
    > > thing.
    > > When I move a mouse over the control I see the following:
    > > "Could not load type CompositeControls.TextBoxLabel from assemply
    > > CompositeControls ..."
    > > Can somebody help, please?
    > >
    > > Here is source code:
    > > using System;
    > >
    > > using System.Web;
    > >
    > > using System.Web.UI;
    > >
    > > using System.Web.UI.WebControls;
    > >
    > > using System.ComponentModel;
    > >
    > > using Infragistics.WebUI.WebDataInput;
    > >
    > > namespace CompositeControls
    > >
    > > {
    > >
    > > // <summary>
    > >
    > > // Summary description for TexBoxLabel
    > >
    > > // </summary>
    > >
    > > [DefaultProperty("Text"),
    > >
    > > ToolboxData("<{0}:TexBoxLabel runat=server></{0}:TexBoxLabel>")]
    > >
    > > public class TextBoxLabel : System.Web.UI.WebControls.WebControl,
    > > INamingContainer
    > >
    > > {
    > >
    > > private Label label;
    > >
    > > private WebMaskEdit textBox;
    > >
    > >
    > > [Bindable(true), Category("Appearance"), DefaultValue("Label")]
    > >
    > > public string LabelText
    > >
    > > {
    > >
    > > get
    > >
    > > {
    > >
    > > EnsureChildControls();
    > >
    > > return label.Text;
    > >
    > > }
    > >
    > > set
    > >
    > > {
    > >
    > > EnsureChildControls();
    > >
    > > label.Text = value;
    > >
    > > }
    > >
    > > }
    > >
    > >
    > > [Bindable(true), Category("Appearance"), DefaultValue(" ")]
    > >
    > > public string Text
    > >
    > > {
    > >
    > > get
    > >
    > > {
    > >
    > > EnsureChildControls();
    > >
    > > return textBox.Text;
    > >
    > > }
    > >
    > > set
    > >
    > > {
    > >
    > > EnsureChildControls();
    > >
    > > textBox.Text = value;
    > >
    > > }
    > >
    > > }
    > >
    > > protected override void CreateChildControls()
    > >
    > > {
    > >
    > > label = new Label();
    > >
    > > label.Height = 20;
    > >
    > > label.Width = 60;
    > >
    > > label.Font.Size = 8;
    > >
    > > this.Controls.Add(label);
    > >
    > > textBox = new WebMaskEdit();
    > >
    > > this.Controls.Add(textBox);
    > >
    > > }
    > >
    > > }
    > >
    > > }
    > >
    > >
    > >

    >
    >
    Mark Goldin, Aug 29, 2004
    #3
  4. Mark Goldin

    Teemu Keiski Guest

    Yes,

    it has only effect on what is the default declarative syntax that will be
    generated when control is dragged on design surface.


    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke



    "Mark Goldin" <> wrote in message
    news:...
    > Is it OK to use the contol without that attribute?
    > "Teemu Keiski" <> wrote in message
    > news:...
    > > With quick glance, not sure why it fails in this case, but removing the
    > > ToolBoxData attribute completely seems to help. Removing it worked in my
    > > test.
    > >
    > > --
    > > Teemu Keiski
    > > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > > ASP.NET Forum Moderator, AspAlliance Columnist
    > > http://blogs.aspadvice.com/joteke
    > >
    > >
    > >
    > > "Mark Goldin" <> wrote in message
    > > news:...
    > > > I have created a Web composite control that consists of a label and
    > > > Infragistics WebMaskEdit text box.
    > > > When I drop that control on my form I have "Error Creating Control

    ...."
    > > > thing.
    > > > When I move a mouse over the control I see the following:
    > > > "Could not load type CompositeControls.TextBoxLabel from assemply
    > > > CompositeControls ..."
    > > > Can somebody help, please?
    > > >
    > > > Here is source code:
    > > > using System;
    > > >
    > > > using System.Web;
    > > >
    > > > using System.Web.UI;
    > > >
    > > > using System.Web.UI.WebControls;
    > > >
    > > > using System.ComponentModel;
    > > >
    > > > using Infragistics.WebUI.WebDataInput;
    > > >
    > > > namespace CompositeControls
    > > >
    > > > {
    > > >
    > > > // <summary>
    > > >
    > > > // Summary description for TexBoxLabel
    > > >
    > > > // </summary>
    > > >
    > > > [DefaultProperty("Text"),
    > > >
    > > > ToolboxData("<{0}:TexBoxLabel runat=server></{0}:TexBoxLabel>")]
    > > >
    > > > public class TextBoxLabel : System.Web.UI.WebControls.WebControl,
    > > > INamingContainer
    > > >
    > > > {
    > > >
    > > > private Label label;
    > > >
    > > > private WebMaskEdit textBox;
    > > >
    > > >
    > > > [Bindable(true), Category("Appearance"), DefaultValue("Label")]
    > > >
    > > > public string LabelText
    > > >
    > > > {
    > > >
    > > > get
    > > >
    > > > {
    > > >
    > > > EnsureChildControls();
    > > >
    > > > return label.Text;
    > > >
    > > > }
    > > >
    > > > set
    > > >
    > > > {
    > > >
    > > > EnsureChildControls();
    > > >
    > > > label.Text = value;
    > > >
    > > > }
    > > >
    > > > }
    > > >
    > > >
    > > > [Bindable(true), Category("Appearance"), DefaultValue(" ")]
    > > >
    > > > public string Text
    > > >
    > > > {
    > > >
    > > > get
    > > >
    > > > {
    > > >
    > > > EnsureChildControls();
    > > >
    > > > return textBox.Text;
    > > >
    > > > }
    > > >
    > > > set
    > > >
    > > > {
    > > >
    > > > EnsureChildControls();
    > > >
    > > > textBox.Text = value;
    > > >
    > > > }
    > > >
    > > > }
    > > >
    > > > protected override void CreateChildControls()
    > > >
    > > > {
    > > >
    > > > label = new Label();
    > > >
    > > > label.Height = 20;
    > > >
    > > > label.Width = 60;
    > > >
    > > > label.Font.Size = 8;
    > > >
    > > > this.Controls.Add(label);
    > > >
    > > > textBox = new WebMaskEdit();
    > > >
    > > > this.Controls.Add(textBox);
    > > >
    > > > }
    > > >
    > > > }
    > > >
    > > > }
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Teemu Keiski, Aug 29, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    709
  2. sleigh
    Replies:
    1
    Views:
    2,676
    sleigh
    Feb 12, 2004
  3. shapper
    Replies:
    6
    Views:
    943
    shapper
    Dec 26, 2007
  4. Chad
    Replies:
    0
    Views:
    214
  5. Mike

    Composite vs non composite Controls

    Mike, Mar 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    254
    Sundararajan
    Mar 11, 2005
Loading...

Share This Page