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

Sachin SinghRank #66 · 26.2K reputationPosted Sep 14, 2021, 5:29 AM EDT
Sowmya Sirsi180 reputationPosted Sep 14, 2021, 6:10 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Sep 14, 2021, 6:15 AM EDT
Sowmya Sirsi180 reputationPosted Sep 14, 2021, 7:38 AM EDT
It is giving me 500 internal server error instead of error what I had set.
If I pass "amount " : 300@
it should through Enter a valid 4 digit number
Instead I am getting 500 error
Sachin SinghRank #66 · 26.2K reputationPosted Sep 14, 2021, 7:47 AM EDT