What is the difference between User Control and Custom Control?
Answer Submitted By : manoharan 9/28/2004 | |
User Control can access only within the current application,if u want to access the user control to other application,u want to copy that user control to that application. Custom control can access from any application becs it is stored in GAC(Global Assembly Cache). We can add the custom control to Visual studio IDE toolbox,but user control can't. User control is good for static layout Custom control is good for dynamic layout | |
Answer Submitted By : S. Suresh 9/28/2004 | |
1. User Controls are easy to create but tedious to use. These are typically ascx files. You can place the controls you want in an ascx files and then use it in aspx file. 2. Custom controls are tedious to create by easy to use. Custom controls are robust and we code it to behave the way we want it. These are typically dlls. Once custom controls are created and reference is added to the project, then we can use it by dragging and dropping into our aspx page. Thanks, S Suresh 09845568305 | |
Answer Submitted By : E.Mohan Kumar (MCP) Suchinfotech Ltd. 6/1/2006 | |
Web custom controls are compiled code, which makes them easier to use but more difficult to create.Once you have created the control 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 make maintenance easier. Web user controls are compiled dynamically at run time they cannot be added to the Toolbox and they are represented by a simple placeholder when added to a page.If you want 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. |
Answer Submitted By : Dhyanchandh.A.V Croszones 1/11/2006 | |
Custom controls are controls that are developed by the developer or a third party vendor. Custom controls are not provided along with .NET. Difference between Custom Controls and User Controls. 1.User Control is a page file with extension .ascx which can only be used within a single application. But custom controls are assemblies(dll files) that can be used in multiple applications. 2.User Controls cannot be added to the ToolBox of VS.NET . To use a user Control with in an aspx page u have to drag the user Control from the solution Explorer to designer page. But Custom Controls can be added to ToolBox of VS.NET. 3.User Controls can be viewed as a sort of generic controls during the design time. The proper GUI of user controls can be viewed only during the run time. But Custom Controls can be viewed during the design time. 4. User controls are created from existing Webserver and html server controls . But a developer who creates custom controls have to render every thing from the scratch. 5.Since the dll assembly of a custom control is being used,a custom control developed in C# can be used in a project developed in VB.NET or any other managed code and vice versa. This is not possible with user controls.They are language spefic We cannot give any examples for custom controls since they are developed either by a developer of a third party vendor. |