Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax for generic (i.e. <T>) web user control

Assuming I have made a web control as follows:

public class TestControl<T> : WebControl
{
    ...
}

Is there any way to place that control on an .aspx page without having to do it via code? I really want to be able to do something like:

<controls:TestControl<int> runat="server" />

But as far as I can tell there is no way of me passing in the generic parameter. I've tried searching on the web and found this http://forums.asp.net/t/1309629.aspx, which appears to be exactly what I'm after, but no one seems to grasp what the guy wanted, and I can't find anything similar on StackOverflow.

like image 719
MadSkunk Avatar asked May 01 '13 10:05

MadSkunk


Video Answer


1 Answers

No. There's no way to do that.

like image 77
John Saunders Avatar answered Oct 03 '22 14:10

John Saunders