THE PROBLEM: in the following piece of code, only the literal controls are shown on the page but the button (web control) doesn´t show! it only shows if i put it before the literal controls but then the literal disapear!!! weird!!! please help!!!
// Create an HtmlButton control.
HtmlButton button = new HtmlButton();
button.InnerHtml = "Click Me! I'm a button!";
PlaceHolder ph1 = new PlaceHolder();
ph1.Controls.Add(new LiteralControl(@"<div id=""Layer1"" style=""position:absolute; width:200px; height:115px; z-index:1; left: 385px; top: 268px"">")); // LITERAL CONTROL
ph1.Controls.Add(button); // WEB CONTROL
ph1.Controls.Add(new LiteralControl("<br>my div - literal</div>")); // LITERAL CONTROL
Session["controls"] = ph1;//ADDS ALL CONTROLS TO SESSION VAR
try // ITERATES THROUGH SESSION CONTROLS
{
PlaceHolder ph2 = ((PlaceHolder)(Session["controls"]));
for (int i = 0; i <= ph2.Controls.Count - 1; i++)
{
PlaceHolder1.Controls.Add(ph2.Controls[i]);
}
}
catch(Exception ex){}
TNX