4
Reply

Differences between user and custom controls in asp.net

Purushottam Rathore

Purushottam Rathore

Jun 13, 2011
35.5k
0

    1.User Control is a page file with extension .ascx which can only be used within
    a single application. But custom controls are assemblies(dll files) that can be
    used in multiple applications.

    2.User Controls cannot be added to the ToolBox of VS.NET . To use a user Control with in an
    aspx page u have to drag the user Control from the solution Explorer to designer page.
    But Custom Controls can be added to ToolBox of VS.NET.

    3.User Controls can be viewed as a sort of generic controls during the design time.
    The proper GUI of user controls can be viewed only during the run time.
    But Custom Controls can be viewed during the design time.

    4. User controls are created from existing Webserver and html server controls .
    But a developer who creates custom controls have to render every thing from the scratch.

    5.Since the dll assembly of a custom control is being used,a custom control developed in C# can be used in a project developed in VB.NET or any other managed code and vice versa.
    This is not possible with user controls.They are language specific

    http://kalitinterviewquestions.blogspot.com/



    kalit sikka
    June 17, 2011
    2

    1. Auser control cannot be added to the Toolbox in Visual Studio whereas custom controls can be added to the Toolbox in Visual Studio.
    2. User controls are good for static layout whereas custom controls are good for dynamic layout.
    3. User controls are easier to create in comparison to custom controls, however user controls can be less convenient to use in advanced scenarios.

    4. Usercontrols have limited support for consumers who use a visual design tool whereas custom controls have full visual design tool support for consumers.

    5. Aseparate copy of the user control is required in each application that uses it whereas only a single copy of the custom control is required, inthe global assembly cache, which makes maintenance easier.

    Purushottam Rathore
    June 13, 2011
    1

    http://www.dotnetfunda.com/interviews/show/379/difference-between-custom-control-and-user-control read this link

    Sonu Chaudhary
    June 09, 2016
    0

    http://www.dotnetfunda.com/interviews/show/379/difference-between-custom-control-and-user-control read this link

    Sonu Chaudhary
    June 09, 2016
    0