title: On edit of my form It is throwing error
body: <p>It might be a silly mistake but taking me ages to solve this issue.</p>
  
  <p>I have existing table called users and I added new column call Approve (bit).
  And on my form Edit I am trying to provide check box to approve User for authorisation. </p>
  
  <p>Below is my form: </p>
  
  <pre><code>&lt;%@ Control Language="C#"    Inherits="System.Web.Mvc.ViewUserControl&lt;EmsAdmin.Models.User&gt;" %&gt;
  &lt;%@ Import Namespace="EmsAdmin.Models" %&gt;
   &lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
  // Focus on the first input box for the site
  $(document).ready(function () {
      $('#UserId').focus();
  });
  
  //]]&gt;
  &lt;/script&gt;
  
  &lt; %= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try
           again.") %&gt;
  &lt;% using (Html.BeginForm())
   {%&gt;
  
   &lt;%= Html.AntiForgeryToken() %&gt;
  
   &lt;p&gt;
  &lt;%= Html.LabelFor(e=&gt;e.Id,"Id:") %&gt;
  &lt;%: Model.Id %&gt;
  
  &lt;/p&gt;
  &lt;p&gt;
  
  &lt;%= Html.LabelFor(e=&gt;e.PersonId,"Person:") %&gt;
    &lt;%= Html.DropDownListFor(e =&gt;
    e.PersonId, (SelectList)ViewData["allPersons"], "Select
   a person", new { @style = "width: 255px;" })%&gt;
   &lt;%= Html.ValidationMessageFor(e=&gt;e.Person,"") %&gt;
   &lt;/p&gt;
  
   &lt;p&gt;
  &lt;%= Html.LabelFor(e=&gt;e.Email,"Email:") %&gt;
  &lt;%= Html.TextBoxFor(e =&gt; e.Email, new { @style = "width:250px;" })%&gt;
  &lt;%= Html.ValidationMessageFor(e=&gt;e.Email,"") %&gt;
   &lt;/p&gt;
  
  &lt;%= Html.LabelFor(e=&gt;e.Approve,"Aprrove User:") %&gt;
  &lt;%= Html.CheckBoxFor(e=&gt;e.Approve) %&gt;&lt;span&gt;&amp;nbsp;Switch this on if you want to
      display whitespace in the widget rather than out of stock logos&lt;/span&gt;
  &lt;%= Html.ValidationMessageFor(e=&gt;e.Approve,"") %&gt;
  </code></pre>
  
  <p></p></p>
  
  <p>
      
      
  </p>
  
  
  
  <p>I am getting below error :</p>
  
  <pre><code>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.InvalidOperationException: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
  
  Source Error: 
  
  
  Line 29: &lt;/p&gt;
  Line 30:     &lt;%= Html.LabelFor(e=&gt;e.Approve,"Aprrove User:") %&gt;
  Line 31:     &lt;%= Html.CheckBoxFor(e=&gt;(bool) e.Approve) %&gt;&lt;span&gt;&amp;nbsp;Switch this on if you want to
  Line 32:         display whitespace in the widget rather than out of stock logos&lt;/span&gt;
  Line 33:     &lt;%= Html.ValidationMessageFor(e=&gt;e.Approve,"") %&gt;
  
  Source File: d:\Dev2010\ems1\Project1\EmsAdmin\Views\ReportUserVerification\UserForm.ascx    Line: 31 
  
  Stack Trace: 
  
  
  [InvalidOperationException: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.]
     System.Web.Mvc.ModelMetadata.FromLambdaExpression(Expression`1 expression, ViewDataDictionary`1 viewData) +513485
     System.Web.Mvc.Html.InputExtensions.CheckBoxFor(HtmlHelper`1 htmlHelper, Expression`1 expression, IDictionary`2 htmlAttributes) +71
     System.Web.Mvc.Html.InputExtensions.CheckBoxFor(HtmlHelper`1 htmlHelper, Expression`1 expression) +54
     ASP.views_reportuserverification_userform_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\Dev2010\ems1\Project1\EmsAdmin\Views\ReportUserVerification\UserForm.ascx:31
     System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
     System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
     System.Web.UI.Control.Render(HtmlTextWriter writer) +10
     System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
     System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
     System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
     System.Web.UI.Page.Render(HtmlTextWriter writer) +29
     System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +41
     System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386
  </code></pre>
  
  <p>My user class:</p>
  
  <pre><code>  using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
  
   namespace EmsAdmin.Models
    {
  /// &lt;summary&gt;
  /// Extends the class created by Linq, so that we can have more control over our linq objects.
  /// &lt;/summary&gt;
  [MetadataType(typeof(UserValidation))]
  public partial class User
  {
      /// &lt;summary&gt;
      ///  A collection of the Interaction Records for this report
      /// &lt;/summary&gt;
      public List&lt;User&gt; Users { get; set; }
  
      /// &lt;summary&gt;
      /// A collection for displaying brands for the user
      /// &lt;/summary&gt;
      public List&lt;Manufacturer&gt; Manufacturers { get; set; }
  
      /// &lt;summary&gt;
      /// Override the to string so that we can use in the delete method to capture details of this record before it is deleted
      /// &lt;/summary&gt;
      /// &lt;returns&gt;&lt;/returns&gt;
      public override string ToString()
      {
          return string.Format("User: Id = {0}, PersonId = {1}, Name = {2}, Email = {3}, Guid = {4}, CreatedAt = {5}, Salt = {6}, Avatar = {7}, Password = {8}, LastLoggedIn = {9}, LoggedInFrom = {10},Approve = {11}", Id, PersonId, Name, Email, Guid, CreatedAt, Salt, Avatar, Password, LastLoggedIn, LoggedInFrom,Approve);
      }
  }
  
  /// &lt;summary&gt;
  /// User Validation
  /// &lt;/summary&gt;
  public class UserValidation
  {
      /// &lt;summary&gt;
      /// PersonId
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "PersonId is required")]
      [Range(1, int.MaxValue, ErrorMessage = "PersonId must be valid")]
      public int PersonId { get; set; }
  
      /// &lt;summary&gt;
      /// Name
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "Name is a required field")]
      [StringLength(128, ErrorMessage = "Name maximum length is 128", MinimumLength = 1)]
      public String Name { get; set; }
  
      /// &lt;summary&gt;
      /// Email
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "Email is a required field")]
      [StringLength(128, ErrorMessage = "Email maximum length is 128", MinimumLength = 1)]
      public String Email { get; set; }
  
      /// &lt;summary&gt;
      /// Guid
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "Guid is a required field")]
      [StringLength(32, ErrorMessage = "Guid maximum length is 32", MinimumLength = 1)]
      public String Guid { get; set; }
  
      /// &lt;summary&gt;
      /// CreatedAt
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "CreatedAt is a required field")]
      public DateTime CreatedAt { get; set; }
  
      /// &lt;summary&gt;
      /// Salt
      /// &lt;/summary&gt;
      [StringLength(9, ErrorMessage = "Salt maximum length is 9")]
      public String Salt { get; set; }
  
      /// &lt;summary&gt;
      /// Avatar
      /// &lt;/summary&gt;
      [StringLength(128, ErrorMessage = "Avatar maximum length is 128")]
      public String Avatar { get; set; }
  
      /// &lt;summary&gt;
      /// Password
      /// &lt;/summary&gt;
      [Required(ErrorMessage = "Password is a required field")]
      [StringLength(512, ErrorMessage = "Password maximum length is 512", MinimumLength = 1)]
      public String Password { get; set; }
  
      /// &lt;summary&gt;
      /// LoggedInFrom
      /// &lt;/summary&gt;
      [StringLength(25, ErrorMessage = "LoggedInFrom maximum length is 25")]
      public String LoggedInFrom { get; set; }
  
  }
  }
  </code></pre>