composite control

Override Default SPAN Tag for Composite Controls

When creating a composite control in ASP.NET, by default, the main container tag that holds all of your controls and HTML is output as a SPAN tag.  One of the issues with this default behaviour is that SPAN elements (at least according to the standard) are "inline" elements.  As opposed to something like "DIV" elements which are "block" level elements, SPAN tags are inline and should only contain other inline elements.  So if you are adding any block level elements to your composite control, in order to be aligned with standar

Add Icon for Custom Control / Composite Control

When a custom control is placed on the toolbox, if it is a professionally made control, it usually has a really nice icon associated with it instead of the default ("paper-looking") icon that Visual Studio inserts when no icon is available.  When you build your own custom control, you can add an icon for the control and embed it in your component's DLL assembly so that it is shown on the toolbox whenever someone adds your control.

Web.config Settings Editor Control

This control provides a "drag and drop" way to dynamically view and edit application and database connection settings in a Web.config file for an ASP.NET website. The control can be dropped onto a blank ASPX page and by default, it will display editable controls for all the settings in the <appSettings> and <connectionSettings> sections of the Web.config file.

Add a Composite Control to the Visual Studio Toolbox

When you create your own custom control or want to add a control from a DLL that contains one or more controls, to use the control by just dragging and dropping it onto an ASPX page is to add it to your Visual Studio Toolbox. The easiest way to do this is to open your "slide out" toolbox in Visual Studio. It should looks something like this:

Fix for Visual Studio 2008 SP1 Design Mode Error - [text] could not be set on [property]

When building a custom / web / composite control in Visual Studio 2008 SP1, once you have a custom property that you attempt to set in design mode, you will see an error similar to this in design view: There was an error rendering the control. [value] could not be set on property [property name] The way to duplicate this error is to set a property from the designer on your control, then right-click the control and choose "Refresh" or just close the hosted ASPX page and re-open in design view. Either way, you will see this error.