Wednesday, February 9, 2011

User Control and Custom Control

User Control

1. If the control you are going to create is only for a particular website then User Control is the best option
2. User controls have a visual interface
3.User control will not appear in tool box and it will not have design support and loaded at runtime.
4. It's an .ascx


1) It has to be provided within a special file called .ascx file
2) It is not a pre-compiled code
3)this will not appear on the ToolBox
4) It is Local to a particular application
5) it supports caching


1) Reusability web page
2) We can’t add to toolbox
3) Just drag and drop from solution explorer to page (aspx)
4) U can register user control to. Aspx page by Register tag
5) A separate copy of the control is required in each application
6) Good for static layout
7) Easier to create
8)Not complied into DLL
9) Here page (user page) can be converted as control then
We can use as control in aspx




Custom Control

1. You create a Custom control when it is going to be used across different applications
2. Custom controls don't a visual interface.
3. Custom controls however can be added to your tool box and used in different applications without re-compiling.
4. It's a .dll


1) It has to be provided within .DLL file
2) it is a pre-compiled code
3) this will be appeared on the ToolBox
4) It is global to all the application
5)It doesn't support caching


1) Reusability of control (or extend functionalities of existing control)
2) We can add toolbox
3) Just drag and drop from toolbox
4) U can register user control to. Aspx page by Register tag
5) A single copy of the control is required in each application
6) Good for dynamics layout
7) Hard to create
8) Compiled in to dll

No comments: