title: How to i get my textbox to only allow numbers 1-14?
body: <p>This is what i have so far, but I am obviously getting an error.</p>
  
  <pre><code>try
  {
      dblNights = Convert.ToDouble(txtNights.Text);
  
      if (dblNights &gt; 1 &amp;&amp; 14)
      {
      }
      else
      {
          string script = "alert(\"Number of Nights Must be between 1 and 14!\");";
          ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
          txtNights.Focus();
      }
  }//End Try
  
  catch
  {
      string script = "alert(\"Number of Nights Must be an Integer!\");";
      ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
  
      txtNights.Focus();
  }//End Catch
  </code></pre>
  
  <p>I am not quite sure what to do to make show an error box if numbers besides 1-14 are entered. Everything else is working, just not that. What am I doing wrong?</p>
  
  <p>Thank you.</p>