0

I am creating my first ASP.NET MVC2 application. I am trying to create a Partial Class for data validation as demonstrated in the nerdDinner application, but MetaDataType has a red line with the message : "The type or namespace 'MetadataType' could not be found (are you missing a using directive or an assembly reference?)"

is there a "using" namespace I'm missing? Here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;
using System.Web.Mvc;
using LanTracerMVC.Models;

namespace LanTracerMVC.Models
{
    [MetadataType(typeof(Request_Validation))]
    //[Bind(Include = "ReqTypeID, ReqBy, ReqStatusID, NewLocationID")]
    public partial class Request
    {


    }//end partial class
    public class Request_Validation
    {


    }
}
user695916
  • 51
  • 1
  • 4

2 Answers2

1

You are missing System.Data.ComponentModel.DataAnnotations

ryudice
  • 36,476
  • 32
  • 115
  • 163
0

Do you have these

Namespace: System.ComponentModel.DataAnnotations

Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

?

MSDN link

Community
  • 1
  • 1
Bala R
  • 107,317
  • 23
  • 199
  • 210