title: loop through each textbox on page
body: <p>I want to loop through each textbox on a web form and clear any text within the control..</p>
  
  <p>I've tried:</p>
  
  <pre><code>    Dim ctrl As TextBox
  
      For Each ctrl In form1.Controls
          ctrl.Text = ""
      Next
  </code></pre>
  
  <p>but I amm getting an error message:</p>
  
  <p>Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.</p>
  
  <p>Any ideas?</p>