Sowmya Sirsi

Sowmya Sirsi

  • NA
  • 173
  • 44.2k

Special charater not accepting

Sep 14 2021 9:14 AM

Hi Team,

 

[Range(1, 1000, ErrorMessage = "Enter a valid 4 digit number")]

public decimal Amount { get; set; }

 

I have applied Range for amount where it is accepting amount as excepted, But If I add any special charater it is throwing 500 internal server instead of ErrorMessage = "Enter a valid 4 digit number"

 

please help me to validate this amount field where it can through an error if I pass any special charater


Answers (5)