title: asp.net mvc3 Bind Exclude on properties does not work
body: <p>I have a class, which has 8 properties / 8 columns in DB. In the Edit page, I want to exclude the AddedDate and UserID fields. When a user edits a voucher, he can't overwrite the AddedDate or UserID values in the DB.</p>
  
  <pre><code>public class Voucher
  {
      public int ID { get; set; }
      public string Title { get; set; }
      public string SiteName { get; set; }
      public string DealURL { get; set; }
      public DateTime AddedDate { get; set; }
      public DateTime? ExpirationDate { get; set; }
      public string VoucherFileURL { get; set; }
      public Guid UserID { get; set; }
  }
  </code></pre>
  
  <p>Here is what I have for Edit controller:</p>
  
  <pre><code>// POST: /Voucher/Edit/5
  
  [HttpPost]
  public ActionResult Edit([Bind(Exclude = "AddedDate")]Voucher voucher)
  {
      if (ModelState.IsValid)
      {
  
          db.Entry(voucher).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View(voucher);
  }
  </code></pre>
  
  <p>On Edit page, when I click on submit, I got the following error:    </p>
  
  <pre><code>System.Data.SqlServerCe.SqlCeException: An overflow occurred while converting to datetime.
  </code></pre>
  
  <p>Seems like the AddedDate didn't get excluded from the voucher object and triggered the error.</p>
  
  <p>Would you please let me know how to fix it? Thanks!</p>
  
  <p>(it is an updated version of <a href="https://stackoverflow.com/questions/9747165/asp-net-mvc3-updatemodel-exclude-properties-is-not-working">asp.net mvc3 UpdateModel exclude properties is not working</a>, I will go with another approach)</p>