0

I'm in situation when I define a Resourses file to change default global messages like (follow tutorial: https://stackoverflow.com/a/10866720/3555947):

FieldMustBeNumeric - {0} not a nummber.
PropertyValueInvalid - {1} is invalid.

and I declare a variable like:

public int number { get; set; }

When I input a string on the form, it always show the message of "PropertyValueInvalid", but I want to show the message of "FieldMustBeNumeric".

Please help me, thank you!

Community
  • 1
  • 1
Hoan Tran
  • 365
  • 3
  • 17
  • Can you show more code? How are you attempting to read the value on the form? What is your exception handling? Where are you setting the error messages? – CindyH Mar 23 '15 at 04:06
  • I follow the tutorial: http://stackoverflow.com/a/10866720/3555947, I just submit data to server side and catch ModelState message. – Hoan Tran Mar 23 '15 at 04:19

0 Answers0