Design Time Attribute For CSS Class in ASP.net Custom Server Control
Posted
by Jon P
on Stack Overflow
See other posts from Stack Overflow
or by Jon P
Published on 2008-10-17T05:58:15Z
Indexed on
2010/05/17
15:50 UTC
Read the original article
Hit count: 380
Hopefully some Custom Control Designers/Builders can help
I'm attempting to build my first custom control that is essential a client detail collection form. There are to be a series of elements to this form that require various styles applied to them. Ideally I'd like the VS 2005/2008 properties interface to be able to apply the CSSClass as it does at the control level, i.e. with a dropdown list of available CSS Clases.
Take for example the Class to be applied to the legend tag
/// <summary>Css Class for Legend</summary>
[Category("Appearance")]
[Browsable(true)]
[DefaultValue("")]
//I am at a loss as to what goes in [Editor]
[Editor(System.Web.UI.CssStyleCollection), typeof(System.Drawing.Design.UITypeEditor))]
public string LegendCSSClass
{
get { return _LegendCSSClass; }
set { _LegendCSSClass = value; }
}
I have tried a couple of options, as you can see from above, without much luck.
Hopefully there is something simple I am missing.
I'd also be happy for references pertaining to the
[Editor]
attribute
© Stack Overflow or respective owner