I was catching up on my blog reading during lunch and came across this post from Mikhail Arkhipov who works for Microsoft. Apparently he is on the ASP.NET 2.0 team and is looking for suggestions on how to solve the problem of declaring instances of generic typesin “code-in-front”.
My suggestion is to strive for 100% XML comformity so that things can be parsed/generated more easily. Therefore, I would go with a custom attribute which is scoped to the ASP.NET schema namespace, like so:
<myNs:MyGenericControl asp:genericParameters="TypeName1, TypeName2+SubTypeName" someTextProperty="Hello World!"/>
Whatcha think? If you’ve got other suggestions, head over there and state your case in his comments section.