foreach (Control cl in this.Page.FindControl("form1").Controls) { if (cl.GetType().ToString() == "System.Web.UI.WebControls.TextBox") { ((TextBox)cl).Text = "1"; } }