Bits and bobs on authoring Web Control
1. Default Tag Prefix.
By defalt VS.NET assign 'cc1'at run time (when the control is dropped to designer canvas). You can assign a different one by modifying AssemblyInfo.cs of the WebControl. Add following lines
...
using System.Web.UI;
...
leads to
[assembly: TagPrefixAttribute("JingyeLuo.IEWebControls", "luo")]
now 'luo' is used instead of 'cc1'
2. Associating custom bitmap with a web control
This will be the bitmap display in the Toolbox for a control
1) Create a 16x16 bitmap of 16 color and set its Build Action to Embedded Resource.
2) Add the ToolboxBitmap to the control class:
[ToolboxBitmap(typeof(JingyeLuo.IEWebControls.ExpandablePanel),"Resources.JingyeLuo.IEWebControls.ExpandablePanel.bmp")
public class ExpandablePanel :
...
I have a bitmap called JingyeLuo.IEWebControls.ExpandablePanel.bmp and located in the folder 'Resources', the name is deliberated -if the bitmap is located at the same place of the control-there is no need for 2nd parameter:
[ToolboxBitmap(typeof(JingyeLuo.IEWebControls.ExpandablePanel))
public class ExpandablePanel :
...