Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:38:21+00:00 2026-06-13T01:38:21+00:00

Beside the annotation-based validation mechanism EF provides the so-called Facets. Meaning on a string

  • 0

Beside the annotation-based validation mechanism EF provides the so-called “Facets”. Meaning on a string property you could have a “Max Length” Facet (through the EF model configuration) where you specify a max-length of 80 chars. Most often this is done automatically by EF when you use a database first approach.

If now the property contains more than the specified number of chars, EF will throw a DbEntityValidationResult with the message

[PropName]: The field [PropName] must be a string or array type with a maximum length of ’80’.

My question: How can I localize such message??? I’d need it in german and italian as well…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:38:22+00:00Added an answer on June 13, 2026 at 1:38 am

    Maarten Balliauw wrote a blog blog about it:

    Localize ASP.NET MVC 2 DataAnnotations validation messages

    Update your classes to use the ErrorMessageResourceType and ErrorMessageResourceName parameters instead of the ErrorMessage parameter that you normally pass.

    Also, you can localize your DisplayNameAttributes; here’s a Stackoverflow post which explains how to do it: Localization of DisplayNameAttribute

    Update

    I think if you install the .NET Framework Language Pack these standard messages should be translated for you.

    A caveat (happened to me): ASP.NET MVC 3 localized validation messages work on my machine, but not on server

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beside query string root folder how do i get the current doc library list(ListName)
How to write comments beside the simulink blocks ... is it possible to have
Why are my errors showing up beside my control and in the validation control
I have two div in my website page one beside the other(one left and
I am trying to display a validation error message beside the form field reportFileURL.
What is this feature called when you add a literal chracter beside the value
The functionality I want is to have a remove button beside each item of
beside heavy processing, should multithreading mainly be used when you have a not quite
I have a barplot beside = T. What I need is to split (or
I have 2 divs beside each other. I would like to have both divs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.