Good day everyone,
I have a doubt on my currently development, the thing is i've created a project using ntier and data application block for my data access layer so, i have a package named Entities where i create all my classes and i was trying to use error messages mapped to a resource file the problem is when i write the following code it marks up with error:
(Entity-Base-Clients)
public partial class Clients {
public Int32 Id {get;set;}
[Display(Name="Name",
ResourceType=typeof(Resources.Language))]
[Required(AllowEmptyStrings=false,
ErrorMessageResourceName="Id",
ErrorMessageResourceType=typeof(Resources.Language))]
public string Name {get;set;}
}
In the following code it marks up error in "Resources" (which is the folder where i put my resource files) and "Language" is the resource file.
But when i do the exactly the same thing on the "Model" folder didn't marks up any error
(Model-Clients)
public Int32 Id {get;set;}
[Display(Name="Name",
ResourceType=typeof(Resources.Language))]
[Required(AllowEmptyStrings=false,
ErrorMessageResourceName="Id",
ErrorMessageResourceType=typeof(Resources.Language))]
public string Name {get;set;}
}
Do i have doing something wrong? am i missing a reference or configuration of the RF?
Thanks in advance
[Display(Name = "Name"), Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName ="nameHasToBeGiven")]
public string name { get; set; }
this one is way easier
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With