Usercontrol vs Custom Server Controls, Any need for Custom Server Controls

Hello

I'm new to ASP.Net so this is probably a stupid question but, is there any need to create customer server controls now that you can pre-compile usercontrols into a dll and thus easily share between applications?

This blog post from David Ebb describes how to do it and the restrictions he note don't seem that bad (other than being able to embed resources such as images in the dll). http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx

His article desribes the techniques for ASP.Net 2.0 and he suggests that there will be further improvements in .Net 3.5 in this area. Does anyone know about these?

Cheers

G

 

0
grazza98
3/16/2009 10:57:37 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

3 Replies
1604 Views

Similar Articles

[PageSpeed] 45

Hi,

UserControls, precompiled or not, are reusable groups of pre-existing controls (and relative business logic).

This is fine in most cases.

But there are times when you need a type of control that is not included in the framework. (eg. chart control, graphic checkbox control, gauge control, etc.)

You may create it inheriting and customizing existing ones, or creating it from scratch, fully implementing its html rendering. I know, this are rare situations... but I would never say Custom Controls are no more useful...


=WereWolf=
--
MCPD
--
Helping someone does not mean giving them what they need, but making them able to get it themselves
--
The Code Golem http://www.codegolem.com/
0
WereWolf
3/16/2009 12:16:31 PM

Hi WereWolf

Thanks for your response. Right ok so, if you want to extend an exiting control, use a control(s) which can't be added to the Toolbox and/or fully control the html rendering then creating Custom Server controls is the way to go?

Otherwise you might as well just create a usercontrol?

Cheers

G

0
grazza98
3/16/2009 12:36:35 PM

Yes, I would say best practice is to project your solution using UserControls.

When your special needs can not be satisfied by UserControls, then think implementing Custom Controls.

The important thing is analyzing the requisites and choosing UserControl or CustomControl while projecting, not when you are already writing your code Wink

 

At least, this is how I am used to work.

Hope it helps. Bye!


=WereWolf=
--
MCPD
--
Helping someone does not mean giving them what they need, but making them able to get it themselves
--
The Code Golem http://www.codegolem.com/
0
WereWolf
3/16/2009 2:13:39 PM
Reply:

Similar Artilces:

Custom Server Control Vs Web Parts, Any need for Custom Server Control
Hello I've just posted a similar question on why you need server controls when you can pre-compile usercontrols and redistribute them. http://forums.asp.net/p/1397433/3010100.aspx#3010100 I've seen lots of (usercontrol vs web part) but not much on web part vs custom server control. According to the MSDN site you can put web parts onto a normal asp.net page outside of a web part zone and they behave just like custom server controls. So, if you are creating a bunch of controls for redistribution to customer asp.net sites and/or SharePoint sites why don't you just create Web Par...

problems listenening to events on a custom server control from another custom server control
 Hi all,I am having problems listening to events on one of custom server controls(AddBookmark) from another custom server control(BookmarkList). The listener or the BookmarkList control has a property that can be set to the AddBookmark control (string at design but the reference is obtained at run-time). I am able to get a reference to the AddBookmark control and add a listener to it on the BookmarkList control on the OnPrender of BookmarkList. But the problem is that when the events on AddBookmark gets fired, the listener added from the BookmarkList is no longer present and the listene...

Server Web User Control or Web Custom Control
Ok, I made a DataGrid I like, stuck it in a Web Control Lib, and then to my toolbar. Now I want to take my nice little control and add it to a greater control, maybe place some buttons around it etc. I could always inherit from it in a new custom control and dynamically add the buttons, but I thought about using a Web User Control. I thought I could easily create a Web User Control, drop on my grid and the buttons on a form, and expose some properties and events, but once I got into it, I got a feeling that this isn't what a Web User Control is for. When designing a control li...

Custom Server Control Made of Custom Controls?
I'm giving myself a crash course in custom server controls, and I have a quick general question. Can I have a custom server control that is composed of other server controls I created. I'm pretty sure the answer is yes, but I want to be positive. Yes http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondevelopingcompositecontrols.asp Shows how to combine existing controls into a new control using class composition. -ron Thanks! ASP.NET so rocks! Making page components extensible objects is such a great idea! I love it....

Custom Server Control - Moving within the VS.Net Designer
Hi, I have created a custom server control that inherits from System.Web.UI.Control. I would like my end users to be able to drag and move the server control in the VS.Net IDE. I presume I have to expose the left/top style properties but can't find anything in the documentation or via google. Any pointers, links or code would be great :) R Hmmm, Inherit from System.Web.UI.WebControls.WebControl or just use the default Create Web Control project in the .Net IDE Can't believe I spent 1 hour looking for this :) Any element can be movable in VS.NET. What it really does is ...

Web Custom Control within a Web Custom Control
I was wondering if this can be done and how. I've created a simple custom control that displays a header which is my first custom control. So I'm just a baby when it comes to this.. Within the header I currently have a property for breadcrumbs which is a string. What I would like to do is have the breadcrumb property  be a Link Button List. I did find a custom control of a Link Button List which is exactly what I wanted. My question is how can/do  I include this into my custom control? Can it done? How? Please help? I'm at a lose here.   Susan You should be able to do ...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Bindable Childrens Controls Form Custom Server Control
Hi all!i have recently created a custom web server control that emit a tab panel it goes like this:<MyCtrl:TabPanel id="mytabs" runat="server"><MyCtrl:TabControl LabelName="Tab1" runat="server"><asp:TextBox id="myTextBox" runat="server"></asp:TextBox></MyCtrl:TabControl><MyCtrl:TabControl LabelName="Tab2" runat="server"><asp:repeater id="list" runat="server">     <ItemTemplate>           <%# Eval("FirstName") %>     </ItemTemplate&g...

Web Form Server Controls Vs. HTML controls
Hi1. What is the difference between Web Form Server controls and HTML controls with runat="server" attribute.e.g. <input type="text" id="mytext" runat="server"> Vs. <asp:TextBox id="mytext" />2. Why we should not use the normal HTML control instead of Server Controls since HTML controls are rendered on client side the performance in using them will be much better that using Web form server controls. Pls. can somebody explain this.- Anand one thing i know. there are much more options for the web controls. and web controls are easier to use than the http controls. for exampl...

Web Server Control Containing another Web Server Control?
I'm building a web server control that needs to include functionality from 3rd party web server control, ASPNetMenu. My web server control needs to render ASPNetMenu at runtime to create a menu. I'd like to do this so that my control's parent ASPX page does not need to register ASPNetMenu or make any configuration changes as this should be done through my web server control. Does anybody have any suggestions on how to do this? Mike - Cache entire web sites at the client and server and keep cache current. Cache just got easier! There are two articles that you would want to be int...

Custom Web Control inside another Custom Web Control
Hi I created a custom web control (CusWebNew) that displays some textboxes by adding them to the ControlCollection of the webcontrol. I also created a custom webcontrol (CustWebButton) that inherts from Button control, and overrided the OnClick function. When I use CustWebButton on a regular web form, it seems to function correctly. However, when I added to be part of the ControlCollection of CustWebNew, it stops to work.   Any ideas why? Thanks Hey, What do you mean by stops to work?  Explain what you are trying to do with it and what it doesn't do.Brian"Trust in the...

HTML Server Control or Web Server Control?
Hi, Being new to ASP.NET I have one thing confusing me much. 1. Whats the major difference between HTML Server Control and Web Server Control? 2. Whats the advantage of processing all the HTML Controls in Server? Server will not be overloaded with this? Which one should I use?..Plain HTML or HTML Server Control or Web Server Control? Thanks and Regards _________________ ASP 2 ASP.NET FYI: http://msdn.microsoft.com/msdnmag/issues/01/09/asp/toc.asp Colt Hi Colt, Thanks for the link. I personally prefer server controls - - there are so many more possi...

html server controls and web server controls
hello what is the difference between html server controls and web server controls? what is the main goal of converting html elements to html server controls , so why i can directly use the web server controls instead of converting process? thank you for the help and for the time If you convert a normal html control to a html server control then you can work with and reference it programmatically. MS advises using web controls where possible. But if your application uses vast amounts of html controls its far easier to just apply runat="server" than to re invent them a...

VS deleting inner content of custom web server controls
I'm trying to use several different custom web server controls in a web form in Visual Studio. Everything works fine until I try to change properties of any one of the custom controls via the VS property window. When I switch back to HTML view from design view, any inner text or controls that had previously existed between the opening and closing tags of the custom control get blown away. Is there any way to avoid this?? These are otherwise fairly simple controls. I've tried it with text, ASP web controls, and custom inner controls. I'm using VS 2003. - DH...

Web resources about - Usercontrol vs Custom Server Controls, Any need for Custom Server Controls - asp.net.web-forms

'url' Top Users - Stack Overflow
current community chat blog Stack Overflow Meta Stack Overflow Stack Overflow Careers your communities Sign up or log in to customize your list. ...

List of content management frameworks - Wikipedia, the free encyclopedia
.NET Framework , works with SQL Server, VistaDB , with XSLT or .NET UserControls Text is available under the Creative Commons Attribution-ShareAlike ...

OPAC Discovery
Switch Language To switch to a different language, select from the following list: English French Spanish Italian British Bulgarian Galician ...

The royal baby - Australian Women's Weekly
MAKE AWW MY HOMEPAGE SUBSCRIBE AND SAVE TODAY FOOD RECIPES ROYALS CELEBS Home Food Recipe search Recipe collections Meal maker Expert Q & A Cookbooks ...

Envoyer par courriel à un ami - Best Buy Canada
Envoyer par courriel à un ami à Best Buy Canada

Bytes - IT + Developer Community - Connect with IT Pros
Bytes.com is a community for Developers and IT Professionals. Join 414,150 members and discuss topics such as software development, networking, ...

Canonical Splines in WPF and Silverlight
January 22, 2009 New York, N.Y. Windows Forms has two methods named DrawCurve and DrawClosedCurve that draw canonical (aka cardinal) splines. ...

Silverlight Toolkit - Issues
Silverlight Toolkit and Silverlight for Windows Phone Toolkit are a set of Microsoft components for developers.

Delicious
Keep, share, and discover the best of the Web using Delicious, the world's leading social bookmarking service.

DotNetNuke Modules – Anatomy of the View
-*+Now that we’ve laid the foundation of DotNetNuke modules, it is time to start looking at the specific modules. While it would be practically ...

Resources last updated: 12/9/2015 12:24:54 AM