In my form i have added one content place holder and also added a button within th e content place holder manually.But now i want to add a button in the same content place holder at runtime. I tried the following code, but the button is not showing in the browser... I don't know what is the problem here...
My Code...
ContentPlaceHolder content = (ContentPlaceHolder)this.Master.FindControl("maincontent");
Button newButton = new System.Web.UI.WebControls.Button();
newButton.ID = "NextButton";
newButton.Text = "Next";
newButton.Visible = true;
content.Controls.Add(newButton);
You've lost the size and location of your button.