title: Trying to set Max and Min value of RangeValidator programatically in ASP.NET
body: <p>I am trying to set Max and Min value of RangeValidator programatically as below:</p>
  
  <pre><code>&lt;asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="RangeValidator" 
  MaximumValue="&lt;%# Max %&gt;" MinimumValue="&lt;%# Min %&gt;" Type="Integer" &gt; 
  Value should be in &lt;%# Min %&gt; and &lt;%# Max %&gt; &lt;/asp:RangeValidator&gt;
  </code></pre>
  
  <p>Here, Min and Max are integer from code behind. However getting error:
  "The value '' of the MaximumValue property of 'RangeValidator1' cannot be converted to type 'Integer'."
  I will really appreciate any help in this regard. Thanks</p>