Hi,
Ques What is the user and custom controls ? Give the differences between user and custom controls ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Mar 14, 2012, 8:38 AM
The short answer is that user controls can be as easy or as complex as you need. You can easily create a simple user conrol. Unless you are sure you need to create a custom control or anything other than a user control, make a user control. A custom control is very likely to be too advanced for you. Since you do not know what a custom control is, do not try to develop one.
See Introduction to Web Custom Controls for an overview of ASP.Net Custom Controls. See Composite Control vs. User Control for a comparison of ASP.Net user controls and comparable ASP.Net custom controls.
See Varieties of Custom Controls for a description of Windows Forms controls. A user control derives from UserControl or from a class derived UserControl. A user control is also called a composite control since user controls contain other controls. A cusom control derives from the Control class. If a Windows Forms control derives from any other class that derives from the Control class, then it is called an Extended control. To develop a Windows Forms custom control, you must be familiar with the "Microsoft Win32® API". So I assume that last point is a deal-breaker for you.
See Control Authoring Overview for an overview of WPF controls. WPF also has a UserControl class. WPF also has controls derived from its Control class or a class derived from it. You can also derive a WPF control from the WPF FrameworkElement class. In WPF, a custom control does not have XAML for the controls in the custom control.
A user control is not a type of custom control. User controls are automatically added to the toolbox.
SenthilkumarPosted Mar 13, 2012, 11:40 PM
The user control is simple to create in .NET. It commonly used to create the common portion of page or same activity can be used in multiple pages across the applications.
It has to be registered on every page or master page using the Register directives.
<%@ Register TagPrefix="UC1" TagName="UserControl1" Src="UserControl1.ascx" %>
Register The user control has to be registered using the src attribute.
It has to be used like the above mentioned form.
The difference between these two controls as per msdn.
If it is useful then mark it as "Accepted Answer"
VulpesPosted Mar 13, 2012, 3:44 PM