Introduction
Both User Control and Custom Control can be created to avoid the work repeatation. Both can be used in multiple applications. Still it is a confusion for many programmers where to use which control .This article explains the difference between both and give a solution to use it as best choice in various applicaitons.
Paragraph Heading 1
Difference in some factors :
* Creation :
User Control : Creation is similar to the way Web Forms pages are created; well-suited for rapid application development (RAD)
Custom Control :Writing involves lots of code because there is no designer support
* Content :
User Control : A much better choice when you need static content within a fixed layout, for example, when you make headers and footers
Custom Control : More suited for when an application requires dynamic content to be displayed; can be reused across an application, for example, for a data bound table control with dynamic rows
* Design :
User Control : Writing doesn't require much application designing because they are authored at design time and mostly contain static data
Custom Control :Writing from scratch requires a good understanding of the control's life cycle and the order in which events execute, which is normally taken care of in user controls.
* Creation :
User Control : Creation is similar to the way Web Forms pages are created; well-suited for rapid application development (RAD)
Custom Control :Writing involves lots of code because there is no designer support
* Content :
User Control : A much better choice when you need static content within a fixed layout, for example, when you make headers and footers
Custom Control : More suited for when an application requires dynamic content to be displayed; can be reused across an application, for example, for a data bound table control with dynamic rows
* Design :
User Control : Writing doesn't require much application designing because they are authored at design time and mostly contain static data
Custom Control :Writing from scratch requires a good understanding of the control's life cycle and the order in which events execute, which is normally taken care of in user controls.
Paragraph Heading N
Difference in Deployment of Both Controls
User Control
1. Designed for single-application scenarios
2. Deployed in the source form (.ascx) along with the source code of the application
3. If the same control needs to be used in more than one application, it introduces redundancy and maintenance problems
Custom Control :
1. Designed so that it can be used by more than one application
2. Deployed either in the application's Bin directory or in the global assembly cache
3. Distributed easily and without problems associated with redundancy and maintenance
User Control
1. Designed for single-application scenarios
2. Deployed in the source form (.ascx) along with the source code of the application
3. If the same control needs to be used in more than one application, it introduces redundancy and maintenance problems
Custom Control :
1. Designed so that it can be used by more than one application
2. Deployed either in the application's Bin directory or in the global assembly cache
3. Distributed easily and without problems associated with redundancy and maintenance
Summary
User Control and Custom Control can be used in option of each other. But the best practice is to use proper control at proper place. This article will help to find the best use of these controls in various applications.
Very nice blog thanks for this update
ReplyDelete.Net Online Training Bangalore
This comment has been removed by the author.
ReplyDelete1 Great article! Very helpful for readers looking for clear insights. For those interested in skill development, check out best training institute in Chennai offering quality courses. Helpful information about best guest posting sites.
ReplyDelete.