I want to build a user control suppose MyDiv.ascx. This control renders the div tag and do few more code behind stuff like adding few attributes etc which is not a matter of
I believe you just need to apply a couple of attributes to the control:
[ParseChildren(false)]
[PersistChildren(true)]
public class MyDiv : UserControl
{
...
You may then need to override AddedControl
- I'm not sure.
Put it this way - that's what works for the one and only user control I've ever written :)