lady_phoenix
New Member
i am dynamically creating a button using C#. but i get an error when it get executed;\[code\]Control 'butidd' of type 'Button' must be placed inside a form tag with runat=server.\[/code\]the code\[code\] Button but = new Button(); but.ID = "butidd"; but.Attributes.Add("runat", "server"); but.Text = "test"; but.Click += new EventHandler(but_click); this.Controls.Add(but);\[/code\]click event:\[code\]void but_click(object sender, EventArgs e){}\[/code\]