stupid dude

J

Jander Clan

Hi to all...

If i open a new web control library and i make a class
that for example inherits from a dropdownlist, is a web
control or web custom control, or a user control, i dont
see the differences...

Thanks in advance.
Jander Clan
 
E

Empire City

If i open a new web control library and i make a class
that for example inherits from a dropdownlist, is a web
control or web custom control, or a user control, i dont
see the differences...

Interesting question. It just went on my to do list of things to learn more
about. Check this out from the VS Help Index:

Recommendations for Web User Controls vs. Web Custom Controls
See Also
Introduction to Web User Controls | Walkthrough: Creating a Web Custom
Control | Walkthrough: Creating a Web User Control

If none of the existing ASP.NET server controls meet the specific
requirements of your applications, you can create either a Web user control
or a Web custom control that encapsulates the functionality you need. The
main difference between the two controls lies in ease of creation vs. ease
of use at design time.

Web user controls are easy to make, but they can be less convenient to use
in advanced scenarios. You develop Web user controls almost exactly the same
way that you develop Web Forms pages. Like Web Forms, user controls can be
created in the visual designer, they can be written with code separated from
the HTML, and they can handle execution events. However, because Web user
controls are compiled dynamically at run time they cannot be added to the
Toolbox, and they are represented by a simple placeholder glyph when added
to a page. This makes Web user controls harder to use if you are accustomed
to full Visual Studio .NET design-time support, including the Properties
window and Design view previews. Also, the only way to share the user
control between applications is to put a separate copy in each application,
which takes more maintenance if you make changes to the control.

Web custom controls are compiled code, which makes them easier to use but
more difficult to create; Web custom controls must be authored in code. Once
you have created the control, however, you can add it to the Toolbox and
display it in a visual designer with full Properties window support and all
the other design-time features of ASP.NET server controls. In addition, you
can install a single copy of the Web custom control in the global assembly
cache and share it between applications, which makes maintenance easier. For
more information see global assembly cache.

If your control has a lot of static layout, a user control might make sense.
If your control is mostly dynamically generated - for instance rows of a
data-bound table, nodes of a tree view, or tabs of a tab control - a custom
control would be a better choice.

The main differences between the two types are outlined in this table:

Web user controls Web custom controls
Easier to create Harder to create
Limited support for consumers who use a visual design tool Full visual
design tool support for consumers
A separate copy of the control is required in each application Only a
single copy of the control is required, in the global assembly cache
Cannot be added to the Toolbox in Visual Studio Can be added to the
Toolbox in Visual Studio
Good for static layout Good for dynamic layout
 
J

Josema

Thanks for your help, its a good information, very clear
explained... Thanks again.
Best Regards.
Josema
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top