title: Is it possible to toggle Validation Data Annotations on/off in MVC 3?
body: <p>I have two separate VIEWS accessing the same MODEL.  When I put the validator data annotations on the model, it works as advertised and prevents the data from being submitted (for both views) if left blank or not within range.  However, I have one view that should be able to allow empty or null values to be saved for a property whereas another view needs to require information to be entered or selected before it lets it through.  In other words, I'd like to turn off the validator on the property within the MODEL for one view and leave it on for the other view.  Here's the example code:</p>
  
  <p>MODEL:</p>
  
  <pre><code>[Range(1, 999, ErrorMessage = "A submittal is required")]
  public int SubmittalId { get; set; }
  </code></pre>
  
  <p>VIEW #1:</p>
  
  <pre><code> &lt;label&gt;@Model.AuditDoc.SubmittalsLabel.ConfigurableLabelDesc&lt;/label&gt; @Html.ValidationMessageFor(x =&gt; x.AuditDoc.SubmittalId) @Html.DropDownListFor(x =&gt; x.AuditDoc.SubmittalId, new SelectList(Model.AuditDoc.ListOfSubmittals, "Id", "Name"))
  </code></pre>
  
  <p>VIEW #2:</p>
  
  <pre><code> &lt;label&gt;@Model.AuditDoc.SubmittalsLabel.ConfigurableLabelDesc&lt;/label&gt; @Html.DropDownListFor(x =&gt; x.AuditDoc.SubmittalId, new SelectList(Model.AuditDoc.ListOfSubmittals, "Id", "Name"))
  </code></pre>
  
  <p>As you can see, I would like to disable that validator data annotation for View #2 and leave it on for View #1.</p>