title: search box, button and gridview
body: <p>How would I implement this:</p>
  
  <p>A user can enter any text in <code>Textbox1</code>, then click <code>Submitbtn1</code> and then show results in a <code>Gridview1</code>. <code>Clearbtn1</code> is used to clear all text in the Textbox1.</p>
  
  <p>This would be all done in Visual Studio ASP.NET Web application.</p>
  
  <p>This is what I have done so far:</p>
  
  <pre><code>namespace SearchApplication
  {
      public partial class _Default : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
          {
  
          }
  
          private void EmptyTextBoxValues(Control parent)
          {
              foreach (Control c in parent.Controls)
              {
                  if ((c.Controls.Count &gt; 0))
                  {
                       EmptyTextBoxValues(c);
                  }
                  else
                  {
                       if (c.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
                       {
                            ((TextBox)(c)).Text = "";
                       }
                       else
                       {
                           //do nothing
                       }
                   }
               }
           }
  
           protected void Button2_Click(object sender, EventArgs e)
           {
               EmptyTextBoxValues(this.Page);
           }
  
           protected void Button1_Click1(object sender, EventArgs e)
           {
  
           }
       }
  }
  </code></pre>