can ASP.NET controls be used with generics? Never seen this done and want a way to differentiate some controls on a page by type, ie: DateTime vs int
example:
public class MyGenericTextBox<T>: TextBox { public MyGenericTextBox<T>() {... } }
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It can be done with a special hack, for example the one I used in this article:
A Typed Repeater in ASP.NET
However I would not recommend doing this just for convenience in simple cases, since the result would be more complex than the thing you’ll try to improve.