I'm creating a button and adding it to a panel \[code\] Panel p = new Panel(); p.ID = "b_con"; p.Attributes.Add("runat", "server"); this.Controls.Add(p); Button b = new Button(); b.Attributes.Add("value", "reply"); b.Attributes.Add("id", Convert.ToInt32(r["Message_ID"]).ToString()); b.Attributes.Add("class", "button"); b.Click += new System.EventHandler(button_Click); p.Controls.Add(b);\[/code\]I got this error Control 'ctl01' of type 'Button' must be placed inside a form tag with runat=server.