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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top