Welcome to AspAdvice Sign in | Join | Help

Generic Web Controls and EnumDropDownList

I just published an article on ASPAlliance that shows a few different techniques for binding a DropDownList control in ASP.NET to an enumerated type (enum).  As part of the article, I wrote a custom control that uses generics to bind a DropDownList<T> to an enum.  Unfortunately, I ran into problems with declaratively defining this control within ASP.NET markup, and thus far there is no support from the ASP.NET engine for generic types within the markup (though it has been discussed here).  In response to my question about this support, Eilon Lipton blogged another approach that uses a ControlBuilder to allow specification of the proper control and its associated generic type within the ASP.NET markup, and is worth a read if this problem is of interest to you.  If you think Microsoft should standardize on some markup for generics within ASP.NET markup and support it in ASP.NET 4.0, please leave a comment, since I know they read this blog.

Published Wednesday, December 05, 2007 2:29 PM by ssmith
Filed under:

Comments

New Comments to this post are disabled