1) Custom controls are written in separate program files that are compiled explicitly and are persisted as an assembly (.dll).User controls are authored using the ASP.NET page syntax, either in the script block or in CodeBehind pages and are implicitly just-in-time compiled by the ASP.NET runtime system.
2) Custom Controls are nicely suited for general re-use as they are easy to package and redistribute as third-party controls. User Controls are best suited for reuse within a web application. Because they are persisted as source files, less chances exist that third parties would like to distribute them.
3) Once created, a custom control can be added to the toolbox of a visual designer, such as Visual Studio .NET, and dragged and dropped onto a page— just like any built-in server control. The visual designer can also support visual manipulation of custom control’s various properties.User controls provide minimal support for use with a visual designer toolbox.
4) A custom control provides minimal support for design-time authoring in a visual designer.A user control provides design-time support for authoring in a visual designer—just like an ASP.NET page.
5) A custom controls inherits System.Web.UI.Control or System.Web.UI.WebControls.WebControl class with class hierarchy (bottom up) either MyCustomControl.Control.Object OR MyCustomControl. WebControl.Control. Object.A user control inherits System.Web.UI.UserControl class with class hierarchy (bottom up) MyUserControl. UserControl. TemplateControl. Control. Object.
6) A custom control is in the form of dynamic linked library (.dll), thus pre-compiled.A user control has extension .ascx and is JIT compiled
7) A custom control does not have any design editor. It may or may not inherit functionality of other standard control(s). It can be an entirely new one.A user control must encapsulate functionality of other web server control(s) through dragging and dropping in design mode
.8 ) A custom control does not have design editor so is harder to create.A user control is easy to create because it can be designed like a page is designed i.e. they have design editor and code behind simultaneously
9) A custom control (newly created or extended) is a separate and pre-compiled component.A user control requires registration and instantiation per page and resides on a page as an object and is compiled along with the page. It is not in pre-compiled form
10) A custom control is more reusable because you do not need a separate copy of it for each application; it can automatically be loaded be from the GAC. Thus giving an advantage of being a framework wide component.A user control cannot be registered with Global Assembly Cache (GAC) .
11) A custom control’s class is not bound with any design. Here you can take the leverage of the flexibility and richness of .NET programming model; you can expose properties, override functions of the base class and also register complex client side logic in the class. A user control cannot provide the level of richness that a custom control can provide.
12) A custom control is the best choice especially when you want to make your controls redistributable, more reusable and make it a Visual Studio IDE aware component.A user control may fulfill your need if you are working on a single web application
13) A custom control cannot use the user control. A user control can use a custom control.
14) The custom control model is designed for authoring redistributable components in the form of an assembly (compiled class library) that can be used by a number of applications. The assembly containing the controls can be used by a single application at a time when placed in the application’s private bin directory, or it can be shared across multiple applications when placed into the global assembly cache, commonly referred to as the GAC. The assembly can be deployed and used in its compiled binary form without the associated source code.The user control model is designed for single-application scenarios. A user control is dynamically compiled at run time when a page that uses it is first requested. As a result, a user control must be deployed in source form, and the .ascx file (and its associated code-behind, if any exists) must be copied into every application that requires the user control.
15) Custom controls are authored by writing a managed class that derives directly or indirectly from System.Web.UI.Control in a .NET programming language.User controls are authored declaratively in the form of .ascx files, which is very similar to the way ASP.NET pages are designed and developed.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment