I need to replace the model state resource (to another language).
I've seen some answers to the question above, but unfortunately I could'nt make it work. Any detailed answer or example would be appriciated.
Thank you.
I need to replace the model state resource (to another language).
I've seen some answers to the question above, but unfortunately I could'nt make it work. Any detailed answer or example would be appriciated.
Thank you.
I don't know about v2, but this works on v1:
PropertyValueInvalid
andPropertyValueRequired
.System.Web.Mvc.DefaultModelBinder.ResourceClassKey = "resource file name"
.Cynthia, try to add this into your web.config
MVC calls
httpContext.GetGlobalResourceObject(ResourceClassKey, "InvalidPropertyValue", CultureInfo.CurrentUICulture)
to find the message, and sometimes you must add those providers to GetGlobalResourceObject find the correct resourceTry using: <%= Html.ValidationMessage("Price") %> without the star "*".
Got It.
In ASP.NET MVC 2 RC, It is PropertyValueInvalid, not InvalidPropertyValue.