Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Why can't I make a custom control from System.Web.UI.HtmlControls.HtmlControl?

Reply
Thread Tools

Why can't I make a custom control from System.Web.UI.HtmlControls.HtmlControl?

 
 
Chris
Guest
Posts: n/a
 
      11-06-2003
Scenario:

I make a custom control, inheriting from
System.Web.UI.HtmlControls.HtmlControl as follows:
public class MyControl : System.Web.UI.HtmlControls.HtmlControl
{
// ...
}

When I attempt to place it in my toolbox in VS, I get the message that
there are no components in my assembly that can be placed on the
toolbox. When I make a simple change to inherit from
System.Web.UI.WebControls.WebControl, I can add the control without a
problem, as follows:
public class MyControl : System.Web.UI.WebControls.WebControl
{
// ...
}

This control does not need to incur the overhead of a WebControl, so
I'd like to make it a "simpler" HtmlControl. Am I missing something?
Can I not use a HtmlControl in the VS.NET toolbox? Is this the wrong
control from which to inherit?

--
Thanks,
Chris
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Chris Simmons
Guest
Posts: n/a
 
      11-06-2003
On 6 Nov 2003 07:39:52 -0800, (E-Mail Removed) (Chris) wrote:

>Scenario:
>
>I make a custom control, inheriting from
>System.Web.UI.HtmlControls.HtmlControl as follows:
>public class MyControl : System.Web.UI.HtmlControls.HtmlControl
>{
> // ...
>}
>
>When I attempt to place it in my toolbox in VS, I get the message that
>there are no components in my assembly that can be placed on the
>toolbox. When I make a simple change to inherit from
>System.Web.UI.WebControls.WebControl, I can add the control without a
>problem, as follows:
>public class MyControl : System.Web.UI.WebControls.WebControl
>{
> // ...
>}
>
>This control does not need to incur the overhead of a WebControl, so
>I'd like to make it a "simpler" HtmlControl. Am I missing something?
>Can I not use a HtmlControl in the VS.NET toolbox? Is this the wrong
>control from which to inherit?


Nevermind. I see VS.NET does not allow it.
--
Chris Simmons
(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
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
How to make a custom control's control public to parent container by default? farmer ASP .Net 2 10-24-2005 10:28 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



Advertisments