Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Need support for specifying custom error message for client validation #2969

@ajaybhargavb

Description

@ajaybhargavb

Related issue - #2817
We now have specific error messages for client validation.
Eg: The field FieldName must be a number
There needs to be a way for users to customize the error message that are sent with the data-val attributes.

MVC 5 has GetUserResourceString for this purpose.
http://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Mvc/ClientDataTypeModelValidatorProvider.cs

return GetUserResourceString(controllerContext, "FieldMustBeNumeric") ?? MvcResources.ClientDataTypeModelValidatorProvider_FieldMustBeNumeric;

Need to have something similar in MVC 6.

cc' @pranavkm @Eilon

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions