Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Custom web control problem

Reply
Thread Tools

Custom web control problem

 
 
Jim Buck
Guest
Posts: n/a
 
      10-07-2003
I built a custom web control and can add it to the
toolbox. However when I drag the control onto a web form
niether the control tags nor the "register" directive get
created. My class looks like the following, does anyone
know what could be wrong. The custom control and the form
are in different assemblies.

[ToolboxItem(true),
DefaultProperty("Name"),
ToolboxBitmap(typeof
(MyControl), "ToolboxBitmaps.MyControl.bmp"),
ToolboxData("<{0}:MyControl runat=server></
{0}:MyControl>")]
public class MyControl : CustomControl
{

// Ommitted
}
 
Reply With Quote
 
 
 
 
Jim Buck
Guest
Posts: n/a
 
      10-07-2003
I figured out the problem.

The default ToolboxItem type, which is used when you send
true to the ToolBoxItemAttribute constructor is the
ToolBoxItem. However since I am writing a web control I
needed to use WebControlToolboxItem.

Thanks

>-----Original Message-----
>I built a custom web control and can add it to the
>toolbox. However when I drag the control onto a web form
>niether the control tags nor the "register" directive get
>created. My class looks like the following, does anyone
>know what could be wrong. The custom control and the

form
>are in different assemblies.
>
>[ToolboxItem(true),
> DefaultProperty("Name"),
> ToolboxBitmap(typeof
>(MyControl), "ToolboxBitmaps.MyControl.bmp"),
> ToolboxData("<{0}:MyControl runat=server></
>{0}:MyControl>")]
>public class MyControl : CustomControl
>{
>
> // Ommitted
>}
>.
>

 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-07-2003
"Jim Buck" <(E-Mail Removed)> wrote in message
news:049101c38d01$c86ac4f0$(E-Mail Removed)...
> I figured out the problem.
>
> The default ToolboxItem type, which is used when you send
> true to the ToolBoxItemAttribute constructor is the
> ToolBoxItem. However since I am writing a web control I
> needed to use WebControlToolboxItem.
>
> Thanks


No. Thank YOU!

I was wondering why my ToolBoxData wasn't working! Now I know.

Where did you find this out? Maybe the answers to my other control mysteries
are there as well.
--
John Saunders
Internet Engineer
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
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
Custom control within a custom control J R M ASP .Net 2 06-01-2006 06:04 PM
Web user control - custom web control - java script. Leyla ASP .Net Web Controls 0 05-01-2006 10:05 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM
Web Custom Control & Custom Collection problem Donald Simpson ASP .Net Web Controls 0 07-11-2003 07:52 AM



Advertisments