I am getting The value 'abc' is not valid for fieldName.
as error message. which is default error message and i want to override it in easier way.
as of now what i have tried is listed below
[RegularExpression(@"^\d+$",ErrorMessage="enter numeric value")]
[Integer(ErrorMessageResourceType = typeof(appName.Resources.abc.Resource), ErrorMessageResourceName = "error_numeric")]
[RegularExpression("([1-9][0-9]*)")]
Range(1,int.max,ErrorMessage="enter numeric value")
but failed to change default error message.
Suggest me the easiest possible way to do this.using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; namespace blueddPES.ViewModels { public class ContactViewModel { [Integer(ErrorMessage="sdfdsf")] public int? hp { get; set; } }