title: MVC3 - Binding DropdownList to int - Value always required
body: <p>I would like to bind a dropdownlist to an integer as follows:</p>
  
  <pre><code>@Html.DropDownListFor(m =&gt; m.ProductID, Model.AllProducts, "")
  </code></pre>
  
  <p>Obviously in the above case I am allowing for a default (blank) value so that no value is chosen by default. My viewmodel is very simple, and doesn't have any annotations for these properties</p>
  
  <pre><code>public SelectList AllProducts {get;set;}
  public int ProductID {get;set;}
  </code></pre>
  
  <p>It appears that because I am binding to an int data validation is forced resulting in data-val* attributes generated in my html and causing my client side validation to fail if i do not choose an option. The alternative seems to be binding to a string rather than an int and then parsing the string on the serverside - however, this seems kind of hackish and i'm wondering if there is an alternative that would allow me to bind to an int, with a default (empty) value but not make this field mandatory</p>
  
  <p>Thank you</p>
  
  <p>JP</p>