Just another WordPress.com weblog

Both User Control and Custom Control can be created to avoid the work repeatation.

User Control:

  • User Controls (.ascx) derived from System.Web.UI.UserControl
  • Designed for single-application Deployed as .ASCX and source code of the application
  • If the same control needs to be used in more than one application, it introduces redundancy and maintenance problems
  • we have to use with in the application and it rests in the application directory.

Eg: A much better choice when you need static content within a fixed layout, for example, when you make headers and footers

Custom Control

  • Custom controls derived from System.Web.UI.WebControls.WebControl(if you want the control to render HTML that generates a visual interface on the client computer) or System.Web.UI.Control(if you want the control to render nonvisual elements. For example, <meta> and <head> are examples of nonvisual rendering)
  • Designed so that it can be used by more than one application
  • Deployed either in the application’s Bin directory or in the global assembly cache
  • Distributed easily and without problems associated with redundancy and maintenance
  • we can keep it in the Toolbox and use it when ever we want

Eg : 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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Tag Cloud

%d bloggers like this: