title: BMI calculator using Event Handlers computation
body: <p>So While working on my BMI calculator, I cannot seem to get the computation section working. I have three text boxes which has information needed to complete the calculation, Height in Feet, Height in Inches, and Weight in lbs.</p>
  
  <p>Here is my code. What seems to be my mistake?</p>
  
  <pre><code>&lt;form id="US" runat="server" visible="true"&gt;
     &lt;div style="background-color:#4DB8FF; width:350px; height:300px; margin:auto; text-align:center; font-family:Arial"&gt;
          &lt;h4&gt;
              Body Mass Index Calculator 
              &lt;asp:Button id="btnUS" runat="server" text="US" OnClick="btnUS_Click" /&gt; 
              &lt;asp:Button id="btnMetric" runat="server" Text="Metric" OnClick="btnMetric_Click" /&gt; &lt;br /&gt;
  
              &lt;script runat="server"&gt;
                  void btnUS_Click(object sender, EventArgs e)
                  {
                      this.US.Visible = true;
                      this.Metric.Visible = false;
                  }
  
                  void btnMetric_Click(object sender, EventArgs e)
                  {
                      this.US.Visible = false;
                      this.Metric.Visible = true;
                  }
  
                  void calcUS_Click(object sender, EventArgs e)
                  {
                      string operand1 = heightus.Text;
                      string operand2 = heightus1.Text;
                      string operand3 = weightus.Text;
  
                      string bmi = resultus.Text;
  
                      double number;
  
                      bool isOperand1Number = Double.TryParse(operand1, out number);
                      bool isOperand2Number = Double.TryParse(operand2, out number);
                      bool isOperand3Number = Double.TryParse(operand3, out number);
  
  
                      if (isOperand1Number &amp;&amp; isOperand2Number &amp;&amp; isOperand3Number)
                      {
                          bmi = (((operand3 / ((operand1 * 12) + operand2) * (operand1 * 12) + operand2))) * 703);
                      }
  
                      else
                      {
                          Response.Write("Please type a numeric value into each of the text boxes.");
                      }
                  }
              &lt;/script&gt;
          &lt;/h4&gt;
  
                    &lt;asp:label ID="lbl1" Text="Height:" runat="server" /&gt;
                       &lt;asp:TextBox ID="heightus" runat="server" /&gt;feet&lt;br /&gt;
                       &lt;asp:TextBox ID="heightus1" runat="server" /&gt;inch(es)&lt;br /&gt;
                    &lt;asp:Label ID="lbl2" Text="Weight:" runat="server" /&gt;
                       &lt;asp:TextBox ID="weightus" runat="server" /&gt;lbs&lt;br /&gt;
                  &lt;br /&gt;
                       &lt;asp:Button ID="calcUS" Text="Calculate"  OnClick="calcUS_Click" runat="server" /&gt;
                       &lt;asp:Button ID="clearUS" runat="server" Text="Clear"/&gt; 
                  &lt;br /&gt;&lt;br /&gt;
                    &lt;asp:Label ID="lbl3" Text="Results:" runat="server" /&gt;
                       &lt;asp:TextBox ID="resultus" runat="server" /&gt; &lt;br /&gt;
  
  
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>