Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Masterpage vs Usercontrol vs Customcontrol

Tags:

.net

asp.net

please help me to understand the difference between Master page vs Usercontrol vs Custom control

like image 257
Vijjendra Avatar asked Apr 30 '11 12:04

Vijjendra


1 Answers

Check the answer to a similar question here:

ASP.Net Custom controls vs. user controls: Are these two the same

Master pages are actually user controls; you can verify this by going to the code-behind of your master page class, right-click on the class name and select "Go To Definition". You will see something like this:

public class MasterPage : UserControl
{
    ...
}

User controls are convenient for display components that are repeated withing a single project, such as menus and panels. The problem is that they do not generate .DLLs and have to be hand-copied to other projects, if needed.

Custom controls on the other hand can be created in separate class libraries and reused as desired across other projects. With custom controls, display artifacts have to be created entirely in code and they take slightly longer to develop.

Check out a comparison between user controls and custom controls from Microsoft:

http://support.microsoft.com/kb/893667

like image 152
IrishChieftain Avatar answered Sep 22 '22 06:09

IrishChieftain