Pnkl
What is the difference between user control and custom control in asp.net?
By Pnkl in ASP.NET on Mar 28 2016
  • Vikas Gore
    Jun, 2019 28

    The main difference between Custom Control and User Control is that they inherit from different levels in the inheritance tree . A Custom Control generally inherits from the System.Windows.Controls.Control class. You may derive from a different custom control depending on your requirement. A UserControl inherits from the System.Windows.Controls.UserControls class, which inherits from the base "Control" class.Custom control is designed for single-application scenarios because if the same control needs to be used in more than one application, it introduces redundancy and maintenance problems. While UserControl designed so that it can be used by more than one application. It can distributed easily and without problems associated with redundancy and maintenance . CustomControl is a loosely coupled control w.r.t code and UI while UserControl is a tightly coupled control w.r.t code and UI. When using CustomControl UI can be changed in different projects but for a UserControl UI is fixed and can't have different looks in different project. Moreover, creating a custom control requires in-depth knowledge of Silverlight UI Model whereas UserControl does not require in-depth knowledge of the UI Model.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS