Skin for programmatically added controls

S

schrader.it

Hi,

after searching hours and hours the net, didn't find any answer, i
decided to ask the experts.
I try to skin some controls, added within codebehind to the
controlscollection of a panel.
The sample:
public partial class LayoutTest : System.Web.UI.Page
{
/// <summary>
///
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
Control c = new Control();
c.SkinID = "Default";
panel.Controls.Add(c);
}
}
The controls will show up within the panel, but without any skinning
and theming. If i put them on the page directly (within the panel),
everything works fine. Any suggestions?

Regards Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top