Tuesday, May 26, 2009

DropDownList with custom attributes on the items

I've created a custom DropDownList web control that enables the use of custom attributes on its items. This is just a rather simple improvement over the standard .NET web control, but a useful one in my opinion.

For example, this control can be used as follows:


AnSPAN style="COLOR: brown">asp:ListItem>
invalidSPAN style="COLOR: brown">asp:ListItem>
itemSPAN style="COLOR: brown">asp:ListItem>
is in hereSPAN style="COLOR: brown">asp:ListItem>
SPAN style="COLOR: brown">mad:DropDownList>

The result being this:


http://weblogs.asp.net/fmarguerie/archive/2003/02/27/3103.aspx

No comments: