13 August 2009

Clear all text boxes by one click in same field..

  • This program for the child webpage of the masterpage..
  • It is the masterpage concept

    ContentPlaceHolder content1 = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
    foreach(Control ctrl in content1.Controls)
    {

    if (ctrl.GetType().ToString() == "System.Web.UI.WebControls.Panel")
    {
    foreach (Control ctr in Panel1.Controls)
    {
    if (ctr.GetType().ToString() =="System.Web.UI.WebControls.TextBox")
    ((TextBox)ctr).Text = string.Empty;
    }
    }
    }