Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Composite control problem

Reply
Thread Tools

Composite control problem

 
 
Mark Goldin
Guest
Posts: n/a
 
      08-28-2004
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);

}

}

}



 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      08-29-2004
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);
>
> }
>
> }
>
> }
>
>
>



 
Reply With Quote
 
 
 
 
Mark Goldin
Guest
Posts: n/a
 
      08-29-2004
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);
> >
> > }
> >
> > }
> >
> > }
> >
> >
> >

>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      08-29-2004
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);
> > >
> > > }
> > >
> > > }
> > >
> > > }
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Composite vs non composite Controls Mike ASP .Net Web Controls 4 03-11-2005 05:47 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57