Dynamically retrieving the executing assembly version attribute - C#

In our C# project the version attribute is defined in a CS file as: 

assembly: AssemblyVersion("3.6.2.5")]

To dynamically retrieve that via code, use the command:

 

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.

CSS File Include Order

Most of the time, when elements are put in the HTML HEAD tag, order does not matter.  But in the case of CSS, not only do styles cascade from the include file to the local file to the element, but styles also cascade in the order that files are included in the page's HEAD tag.  The following is a quick test that shows how the order that files are included affects the rendering of a CSS styled element.  This CSS code has been tested on Internet Explorer 8, Safari 4, and Firefox 3.5. 

CSS Shorthands and Input Styling

The following is a list of useful shorthands for specifying typically large CSS properties in a small and succinct one line definition.  This not only keeps your CSS files clean and easy to read, but more importantly, it significantly reduces the size of your CSS files.