user control and custom control

What is different between Web User Control and Web Custom Control?

1/22/2008 6:21:45 PM 91979 articles. 4 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 28

Thanks, Ed

Microsoft MVP - ASP/ASP.NET

1/22/2008 6:24:49 PM

I would suggest you to google the word "different between Web User Control and Web Custom Control" to get more informations and results...


"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1/22/2008 6:43:18 PM
  1. Web custom controls are compiled components that run on the server and that encapsulate user-interface and other related functionality into reusable packages. They can include all the design-time features of standard ASP.NET server controls, including full support for Visual Studio design features such as the Properties window, the visual designer, and the Toolbox.
    There are several ways that you can create Web custom controls:
    • You can compile a control that combines the functionality of two or more existing controls. For example, if you need a control that encapsulates a button and a text box, you can create it by compiling the existing controls together.
    • If an existing server control almost meets your requirements but lacks some required features, you can customize the control by deriving from it and overriding its properties, methods, and events.
    • If none of the existing Web server controls (or their combinations) meet your requirements, you can create a custom control by deriving from one of the base control classes. These classes provide all the basic functionality of Web server controls, so you can focus on programming the features you need.
If none of the existing ASP.NET server controls meet the specific requirements of your applications, you can create either a Web user control or a Web custom control that encapsulates the functionality you need. The main difference between the two controls lies in ease of creation vs. ease of use at design time.
Web user controls
are easy to make, but they can be less convenient to use in advanced scenarios. You develop Web user controls almost exactly the same way that you develop Web Forms pages. Like Web Forms, user controls can be created in the visual designer, they can be written with code separated from the HTML, and they can handle execution events. However, because Web user controls are compiled dynamically at run time they cannot be added to the Toolbox, and they are represented by a simple placeholder glyph when added to a page. This makes Web user controls harder to use if you are accustomed to full Visual Studio .NET design-time support, including the Properties window and Design view previews. Also, the only way to share the user control between applications is to put a separate copy in each application, which takes more maintenance if you make changes to the control.
Web custom controls
are compiled code, which makes them easier to use but more difficult to create; Web custom controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and display it in a visual designer with full Properties window support and all the other design-time features of ASP.NET server controls. In addition, you can install a single copy of the Web custom control in the global assembly cache and share it between applications, which makes maintenance easier.

Web user controls

Web custom controls
Easier to create Harder to create
Limited support for consumers who use a visual design tool Full visual design tool support for consumers
A separate copy of the control is required in each application Only a single copy of the control is required, in the global assembly cache
Cannot be added to the Toolbox in Visual Studio Can be added to the Toolbox in Visual Studio
Good for static layout Good for dynamic layout
1/25/2008 11:16:34 PM

Similar Artilces:

User Control VB.Net x Web Custom Control
I was thinking in create a user control in VB.Net, and use it in a Asp.Net as possible? So I thought about it is gonna be better than make a Web Custom Control, so i thought again, nope... But i need to know better because a don't have a progress bar in for example.... Could Somebody tell me about??? in a reallity i know the asnwer but i would like to explain by myself... Thank's Antonio...

user control or custom control ?
i have datagrid which shows monthyear user control for each row. The month year user control has two drop down list. one is for year and other one is for month. So for each row in particular column i'll have that user control loaded. it works fine but ut takes lot of time in rendering when there are 200 rows. what would be the solution. will custom control help? Hi,Lax4u: Some tips i am not quite sure. First, you can disable the viewstate of the userControl to make it not load so many information in each postback and store the necessary in the global range. Second, Caching porting of th...

User Controls and Custom Controls
what is Diff between User Controls and Custom Controls? User controls are asmx files, you can use them as a webpage, drag and drop as many controls you want and still user the user control to drop it into a form.Custom Controls are inherit from the control or used as composite control. You need to write the control by hand and override all the properties. They can be added into your toolbar.Hope this helpsCheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question! Also... User Controls are generally application specific.  If you want...

Custom Controls or User Controls
Hi, I have to create a menu control and I am unable to decide between a custom control or user control.  Apart from the fact that a custom control can be inserted into the toolbox what are the other advantages and disadvantages of each like performance, and so on.  Plus how do I decide between the two. Thanks Arjuna. Hello Please refer to the KB article Overview of user controls vs. custom controls Hope it helps, JessicaJessica CaoSincerely,Microsoft Online Community Support“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer...

Custom User Controls v. Custom Web Controls
Hi! Is it better for me to begin coding my controls instead of just designing them? What would the benefits be? I meen, i seem to be able to get all i need from just putting stuff together on an ASCX file but i'm obviously missing a huge concept here... please explain! Hi, creating user controls is indeed easier than creating custom server controls because you can simply drag & drop other controls on the form, easily add events to it, ... Custom controls however are better when you want to reuse them in several other projects. I like to create custom controls for small, reusable com...

Custom composite contorl contains custom contols: controls collection gets empty (Or control get reinitialized) on postback.
Hi, I'm  developing a ASP .Net custom server control library. Where all the basic(Text,check,etc) controls are working well. I have developed an composite control which is more like a Tabular control with the basic custom controls in every cell. The problem is, this composite control reinitializes on post back. I 've added the custom controls (in CreateChildControls method) as cell.controls.add(customcontrol)  row.controls.add(cell) ; this.controls.add(row) Please give me a solution as early as possible IMXO. ASP.NET constructs and reinitializes&n...

custom popup user control, just getting started...
I've used the ajax modalpopupextender and some css to make a pretty little popup window, which works just great.  I need to use this popup in dozens of different places on a web application so it really should be turned into a user control.  That's where I'm a little stumped though, I've made very simple ascx user controls before but this looks like it will be a little more difficult.  Here's one of the popups that I want to convert to a user control.<asp:Button id="btnDummy" runat="server" style="display:none" /><cc1:...

custom popup user control, just getting started...
I've used the ajax modalpopupextender and some css to make a pretty little popup window, which works just great.  I need to use this popup in dozens of different places on a web application so it really should be turned into a user control.  That's where I'm a little stumped though, I've made very simple ascx user controls before but this looks like it will be a little different.  Here's one of the popups that I want to convert to a user control. <asp:Button id="btnDummy" runat="server" style="display:none" /><cc1:Mod...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

User Control in a User Control
I have a first user control that contain a second user control. If I cahe the first user control can I still dynamically control the second one or it is cached with the first one therefore can not control it anymore? Thanks When your first control is cached, its rendered out and its output is stored in the cache. On every request to the page containing your control that can satisfy it from cache, the output will just simply be inserted - your first control will never be instantiated or run in that case, so the second one wont be either. Hope this helps,Mike VolodarskyProgram Manager...

User control in a user control
Hello all, I have created a user control with some checkboxes, and public properties to get the values of these checkboxes. I have also created a second user control using the first user control; this second control also access the public properties of the first one. My problem is when I implement the second control in an aspx page, if I click at runtime the checkboxes in the first control, I am able to access its public properties from the methods of the second control but the values of these properties are wrong. while at design time, I do not have this problem. Than...

user control to user control
I have an aspx page that have a "Register" directive to two usercontrol called rptMaster.ascx and rptDetail.ascx. I'm trying to set up a Master-Detail relationship and wish for the rptMaster.ascx to trigger and event from a dropdownlist and for the rptDetail to be listening for DropDownList event. I believe I have gotten the events part okay with help from this articel but my declaration for a private statement to my rptMaster class is producing an error. I'm using beta 2 of and I 'm having trouble getting a reference TO ...

User Controls in User Controls?
I have the follow set up and it is throwing an error "Unhandled error loading module" ... is there some trick to this that I don't know?I have a project A that uses controls from project B (project B is just a project with all my user controls used through out other modules).  project A uses user control 1 from project B with out any issues at all - great.  But then I wanted to add user control 2 to user control 1 and that is when I get my error.  In fact I don't even have the user control 2 in user control 1, just when I put the register part into user control 1 is when it al...

User Control controls not created when dynamically creating user control
  Have created a user control for displaying and editing a dynamically number of values. The user control contains two labels and an edit box. When dynamically loading the user control I get an error when the control itself tries to change setting on the fields within the user control.   Why doesnt this work? It works okay if I dont load it dynamically but create a user-control-instance in the aspx-page but thats no solution.   Thankyou!     Here is my code:   ucDataValue.ascx   <%@ Control Language="C#" AutoEventWireup="true&...

Web resources about - user control and custom control -

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Insteon adds Sonos integration to control speakers from its iOS app & hardware
Users of Insteon’s connected home automation products will now be able to control their Sonos speakers directly from Insteon hardware and the ...

Control your Audi with your Apple TV, if you want to
Filed under: 2016 CES , Audi , Gadgets , Smartphone , Technology Have an A4 or Q7 and a new Apple TV? Audi will let them talk to each other on ...

Nexia brings voice control through Amazon Echo, adds upgraded Windows 10 app
... built on Microsoft's Universal Windows platform, meaning it can run on all devices. The biggest feature being added is the ability to control ...

Larwyn’s Linx: A Thorough Fisking Of Obama’s Executive Orders On Gun Control
... install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation A Thorough Fisking Of Obama’s Executive Orders On Gun Control ...

The Nuclear Option — Executive Gun Control: Obama Creates ‘Crazy List,’ Disarms the Elderly
When all the hectoring is finished, the professorial lecturing is done, all the political posturing is over, all that is left are tears. And ...

UK police forces are going to use drones to help them control protests and carry out sieges
UK police forces are going to start using drones to help them control protests, investigate burglaries and carry out sieges, according to The ...

Bug in Silent Circle's Blackphone let attackers remotely control device
... a remote takeover vulnerability that attackers could exploit to send and receive text messages, to eavesdrop on calls and to remotely control ...

Obama Enlists DOD In Gun Control Push
'Expedite the real-world deployment of such technology for use in practice'

Here Are Obama's New Executive Actions On Gun Control
The orders are designed to bypass a gridlocked Congress

Resources last updated: 1/7/2016 11:24:16 AM