I have a property on my viewmodel of type int?
/// <summary>
/// Represents A company Id
/// </summary>
[Range(1, 999999999, ErrorMessage="Error"])
public int? CompanyId{ get; set; }
From the textbox I user enter a big number that overflows int32 maxValue, then I think
an internal validation exception is thrown but the message doesn't appear.
I am overriding default messages in global.asax by calling:
DefaultModelBinder.ResourceClassKey = "GlobalResources";
Do you know what key I should enter to override resources so that the message will appear? Is there any specific message for Int32 overflow?
I've overridden the PropertyValueInvalid but it doesn't show. It seems like there is another key that need to be overridden. Please point me where can I find all list of default keys.
View? If so, can you post the code for theView?@Html.ValidationMessageFor(model => model.CompanyId)on yourView?