title: asp.net empty textbox help needed
body: <p>I created a basic web form application where user enters their name, age and gender in to different textboxes, when that is done they press submit button which then produces the result into a label. The problem I'm having is if no text is entered and someone presses submit the label still says</p>
  
  <blockquote>
    <p>hello {}  i am   {}    years old and im {}</p>
  </blockquote>
  
  <p>The <code>{}</code> are where the name, age and gender appears...</p>
  
  <p>How do I get around this? I know I can put if statement and check to see if all textboxes are not null but is there an efficient or quicker way?</p>
  
  <p>here is the field validatiors i used: </p>
  
  <pre><code> &lt;asp:TextBox ID="txtname" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="textbox1" ErrorMessage="Name required"&gt;&lt;/asp:RequiredFieldValidator&gt;
  
  &lt;asp:TextBox ID="txtage" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="textbox2" ErrorMessage="Input age"&gt;&lt;/asp:RequiredFieldValidator&gt;
  
  &lt;asp:TextBox ID="txtnumber" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="textbox3" ErrorMessage="input gender"&gt;&lt;/asp:RequiredFieldValidator&gt;
  </code></pre>