What is different between Web User Control and Web Custom
Control?



What is different between Web User Control and Web Custom Control?..

Answer / guest

Web custom controls are compiled components that run on the
server and that encapsulate user-interface and other related
functionality into reusable packages. They can include all
the design-time features of standard ASP.NET server
controls, including full support for Visual Studio design
features such as the Properties window, the visual designer,
and the Toolbox.
There are several ways that you can create Web custom controls:
? You can compile a control that combines the functionality
of two or more existing controls. For example, if you need a
control that encapsulates a button and a text box, you can
create it by compiling the existing controls together.
? If an existing server control almost meets your
requirements but lacks some required features, you can
customize the control by deriving from it and overriding its
properties, methods, and events.
? If none of the existing Web server controls (or their
combinations) meet your requirements, you can create a
custom control by deriving from one of the base control
classes. These classes provide all the basic functionality
of Web server controls, so you can focus on programming the
features you need.
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.

Web user controls
--------------------
Easier to create
Limited support for consumers who use a visual design tool
A separate copy of the control is required in each application
Cannot be added to the Toolbox in Visual Studio
Good for static layout


Web custom controls
-------------------------
Harder to create
Full visual design tool support for consumers
Only a single copy of the control is required, in the global
assembly cache
Can be added to the Toolbox in Visual Studio
Good for dynamic layout

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More Dot Net General Interview Questions

How is .net able to support a lot of languages?

0 Answers  


Explain about the features and elements present in Visual studio.NET IDE?

0 Answers  


Explain how to manage pagination in a page using .net?

0 Answers  


How to convert a .NET object into COM operabililty?

0 Answers   Petranics Solutions,


Explain is the jit an interpreter?

0 Answers  






What is il and c#?

0 Answers  


Why did they call it .net?

0 Answers  


Explain role-based security in .Net.

2 Answers  


What is the difference between imperative and interrogative code?

0 Answers  


What is deferred execution vs. Immediate execution in linq?

0 Answers  


Tell us what is a sealed class?

0 Answers  


Is the COM architecture same as .Net architecture? What is the difference between them (if at all there is)?

0 Answers   Infosys,


Categories