c# - Why this range attribute in mvc does not give me right answer.? -


i'm trying apply range attribute on class field this.

 [range(typeof(int32), "1","999", errormessage = "must number between 1  , 999")]   public long? fieldname{ get; set; } 

but doesn't validate range expecting. supposed validate range between 1 , 999. how resolve issue.

try this..........

[range(typeof(int32), "1", "999", errormessage = "must positive natural number between 1 , 999")] [regularexpression("^[0-9]{1,3}$", errormessage = "must positive natural number between 1 , 999")] public long? fieldname { get; set; }


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -