Dennis Bottjer | ASP.NET + SharePoint Architect, Trainer & Speaker

"An Ounce of Prevention is Worth a Pound of Cure" - Ben Franklin
posts - 168, comments - 59, trackbacks - 41

My Links

News

Add to Technorati Favorites The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.

Tag Cloud

Archives

Post Categories

Useful Custom Server Control Namespaces

No matter what your .NET language of choice is all .NET languages use base classes contained within the namespaces of the .NET Framework.  Knowing them well can save you much time.

 

When building custom sever controls I like to include the following two namespaces:

 

System.Drawing

System.ComponentModel

 

Among other things the System.Drawing namespace allows you to specify a Tool Box Bitmap image for you Custom Server Control which really gives the control a professional touch.  To specify a Tool Box Bitmap Image you would add the following attribute to you custom control class:

 

ToolboxBitmap(typeof(System.Web.UI.WebControls.TextBox)

 

Notice the use of the typeof method to display a TextBox Bitmap.

 

The System.ComponentModel namespace is needed to specify category attributes to the properties of your server control.  This will help you organize your properties in the property window according to use.

Print | posted on Saturday, December 10, 2005 1:18 AM | Filed Under [ ASP.NET ]

Comments have been closed on this topic.

Powered by: