Button myButton = new Button(); myButton.Text = "Click me!"; myButton.Click += MyButton_Click; this.Controls.Add(myButton);
TextBox myTextbox = new TextBox(); myTextbox.ID = "myTextbox"; myTextbox.Width = 200; myTextbox.Text = "Enter your name"; this.Controls.Add(myTextbox);
Label myLabel = new Label(); myLabel.Text = "Hello, World!"; this.Controls.Add(myLabel);This code creates a new label control and sets its text to "Hello, World!". The System.Web.UI Control package library is part of the .NET Framework and is used for developing web-based applications with C#.