Author: pedroponting | Posted on: 10/4/2009 4:35:27 PM | Views : 280

OK, so I want to be able to create a user control and add it to my page programmatically, accessing it's public properties from my code. Please note, I'm not after how to add a user control to my page programmatically. I know how to do that. It's getting the compiler to recognise the class at compile time rather than simply adding it in at runtime that I'm struggling with. So far, the only way I've found to be able to do this is to create the entire user control as a C# class in my App_Code folder. Then I can instantiate the class in the code-behind and add it to the page's controls and all is hunky dory. But I want to be able to use this same user control declaratively, so I have the option of setting it's properties declaratively in ASP.NEt markup or programmatically in C#. 
My user control is a little doovery-whatsit that renders non-standard fonts as gifs - all I have to do is specify attributes such as the desired font and size. My ...

Go to the complete details ...