0

Could any give me a best Custom control application with code snippet and explain me the basic difference between Custom control and user control? Thanks in advance , Laxmi

Mike Cole
  • 14,474
  • 28
  • 114
  • 194
Hemant Kumar
  • 4,593
  • 9
  • 56
  • 95
  • [Difference between User Control and Custom Control?](http://stackoverflow.com/q/367640/102112) – Oleks Mar 10 '11 at 09:19
  • [What are the differences between User Controls, Server Controls & Custom Controls?](http://stackoverflow.com/q/994009/102112) – Oleks Mar 10 '11 at 09:21
  • [ASP.Net Custom controls vs. user controls: Are these two the same](http://stackoverflow.com/q/673370/102112) – Oleks Mar 10 '11 at 09:24
  • end even [user control vs custom control](http://stackoverflow.com/q/3750596/102112) – Oleks Mar 10 '11 at 09:27
  • Please take a look at the following articles regarding this issue: [Recommendations for Web User Controls vs. Web Custom Controls](http://msdn.microsoft.com/en-us/library/aa651710%28v=vs.71%29.aspx) [Overview of user controls vs. custom controls](http://support.microsoft.com/kb/893667) – Mikhail Mar 10 '11 at 05:49

1 Answers1

4

User Control is collection or grouping of WebControls. It is similar to aspx page and is used to place common markup code in a common file.

Refer Web Forms User Controls to create user control, convert page to user control, consume user control, e.t.c

Custom Control Inherits from WebControl to achieve some extra functionality. These are classes.

Sample Custom Control

public class DropdownListExtended : DropdownList
{
    // My custom logic
    // ususaly an event is overriden by developers to achieve extra functionality
}
  • Webcontrols:- are TextBox, Label, DropdownList, e.t.c

Hopefully your understanding are builds.

Waqas Raja
  • 10,802
  • 4
  • 33
  • 38