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 |
What is a Strong Name?
With these events, why wouldn't microsoft combine invalidate and paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?
Is .net core stable?
Types of JIT and what is econo-JIT ?
What is Assembly manifest? what all details the assembly manifest will contain.
Difference between dispose and finallize method?
What are the differences between user control and server control?
What are the challenging issues you have faced in implementation project/Maintainance project in .net Functionality? How you have overcome that issue?
Whate are resource files?
How to load the contents of an xml file into an xmldocument object?
What is the benefit of .net core?
Best Dot Net Center in Chennai ?