title: ASP.NET RangeValidator weirdness with MaximumValue
body: <p>I have a pretty simple ASP.NET page with some input fields and validators. One field accepting a double looks like this:</p>
  
  <pre><code>&lt;asp:TextBox ID="tbHeight" runat="server" /&gt;
  &lt;asp:RangeValidator ID="vdHeight" runat="server" 
      ErrorMessage="Height must be a positive number" Text="*" 
      ControlToValidate="tbHeight" MinimumValue="0" Type="Double" /&gt;
  </code></pre>
  
  <p><strike>This works as expected, and the user must enter a number >= 0.</strike><br>
  <em>Update: this does not work as expected afterall (some weird bug in the project). See comments to the answers below for details</em></p>
  
  <p>I then try the same for a field accepting an integer:</p>
  
  <pre><code>&lt;asp:TextBox ID="tbGrossTonnage" runat="server" /&gt;
  &lt;asp:RangeValidator ID="vdGrossTonnage" runat="server" 
      ErrorMessage="Gross Tonnage must be a positive whole number" Text="*" 
      ControlToValidate="tbGrossTonnage" MinimumValue="0" Type="Integer" /&gt;
  </code></pre>
  
  <p>When loading the ASP-page, this gives me the following error: <em>The value '' of the MaximumValue property of 'vdGrossTonnage' cannot be converted to type 'Integer'.</em></p>
  
  <p>I don't have any specific max value requirements in the system, so I would just like it to "default" to <code>Int32.MaxValue</code> (although I'd have to enter 2,147,483,647, since <code>MaximumValue</code> doesn't seem to accept the <code>Int32.MaxValue</code> constant). </p>
  
  <p>Why is it that a <code>RangeValidator</code> of the type <code>Integer</code> won't accept a missing <code>MaximumValue</code> property, but for one of the type <code>Double</code> this is ok?</p>