Hi,

Why am I receiving the error: The name "Exclude" does not exist in current context when using the following code?

asp Code:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.Web.Mvc;
  8.  
  9.  
  10. namespace MvcMusicStore.Models
  11. {
  12.     [MetadataType(typeof(AlbumMetaData))]
  13.     public partial class Album
  14.     {
  15.         //Validation rules for Album class
  16.         [Bind(Exclude == "AlbumID")]
  17.         public class AlbumMetaData
  18.         {
  19.             [ScaffoldColumn(false)]
  20.             public object AlbumId {get; set;}
  21.             [DisplayName("Genre")]
  22.             public object GenreId { get; set; }
  23.             [DisplayName("Artist")]
  24.             public object ArtistId { get; set; }
  25.             [Required(ErrorMessage = "An album title is required")]
  26.             [StringLength(160)]
  27.             public object Title { get; set; }
  28.             [DisplayName("Album Art URL")]
  29.             [StringLength(1024)]
  30.             public object AlbumArtURL { get; set; }
  31.             [Required(ErrorMessage = "Price is required")]
  32.             [Range(0.01, 100.00, ErrorMessage = "Price must be between 0.01 and 100.00")]
  33.             public object Price { get; set; }
  34.         }
  35.     }
  36. }

Thanks,


Nightwalker