0

Hi I am using a model having

 [Range(1, 4, ErrorMessageResourceName = "NameRequiredError", ErrorMessageResourceType =typeof(Resources.PatientNotes))]
 public int ActionType { get; set; }

My Resource file contains key as NameRequiredError and its value as "Name is required" but when I run I don't get any error and My Model State is valid but when I use

 [Range(1, 4)]
 public int ActionType { get; set; }

then it gives me proper error and ModelState.IsValid as False

The problem is only when I use separate project for resource file; otherwise it works well.

Mrchief
  • 75,126
  • 20
  • 142
  • 189
Ajay Suwalka
  • 549
  • 1
  • 7
  • 24
  • Are you sure your reference to your seperate resource file is correct? – heymega Oct 09 '14 at 13:18
  • Yes, I am just copying and Pasting That File Directly to another project. I am just unable to locate – Ajay Suwalka Oct 09 '14 at 14:01
  • Take a look at the answers here, may help: http://stackoverflow.com/questions/2537958/override-a-resource-from-standard-assembly-in-asp-net – Mrchief Oct 09 '14 at 19:48

0 Answers0