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

  • SEARCH
  • Home
  • 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 8061077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:12:35+00:00 2026-06-05T10:12:35+00:00

i have a problem internationalizing my code. It pretty much works great everywhere on

  • 0

i have a problem internationalizing my code. It pretty much works great everywhere on my site, except in this part of code.

[DataType(DataType.Password)]
    [Display(ResourceType = typeof(strings), Name = "BevestigWachtwoord")]
    private CultureInfo resourceCulture;
    [Compare("Password", ErrorMessage = ResourceManager.GetString("PassMismatch",resourceCulture))]
    public string ConfirmPassword { get; set; }

the error(Object reference is required………) is at ResourceManager.GetString(“PassMismatch”,resourceCulture))]
I get the same error if i try ErrorMessage=strings.PassMismatch (where strings is my resourse file)
when i just fill in a string, it does work.
i had the same problem for display, but i fixed that by doing

[Display(ResourceType = typeof(strings), Name = "Email")]

Is there something similar i can try here?

EDIT : My Errors

Error 13 An object reference is required for the non-static field, method, or property ‘MvcApplication2.Models.RegisterModel.resourceCulture’ C:\Users\stuart\documents\visual studio 2010\Projects\MvcApplication2\MvcApplication2\Models\AccountModels.cs 74 86 MvcApplication2
Error 14 An object reference is required for the non-static field, method, or property ‘System.Resources.ResourceManager.GetString(string, System.Globalization.CultureInfo)’ C:\Users\stuart\documents\visual studio 2010\Projects\MvcApplication2\MvcApplication2\Models\AccountModels.cs 74 45 MvcApplication2
Error 11 The expression being assigned to ‘MvcApplication2.Models.RegisterModel.error’ must be constant C:\Users\stuart\documents\visual studio 2010\Projects\MvcApplication2\MvcApplication2\Models\AccountModels.cs 67 30 MvcApplication2
Error 12 The property or indexer ‘MvcApplication2.strings.PassMismatch’ cannot be used in this context because it lacks the get accessor C:\Users\stuart\documents\visual studio 2010\Projects\MvcApplication2\MvcApplication2\Models\AccountModels.cs 67 30 MvcApplication2

for the other comment, i’m trying stuff like
ErrorMessage = resourceCulture ResourceManager.GetString(“PassMismatch”,Thread.CurrentThread.CurrentUICulture))]

but just nothing is working

  • 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-05T10:12:37+00:00Added an answer on June 5, 2026 at 10:12 am

    Replace this line:

    [Compare("Password", ErrorMessage = ResourceManager.GetString("PassMismatch",resourceCulture))]
    

    With this line:

    [Compare("Password", ErrorMessageResourceType = typeof(strings), ErrorMessageResourceName = "PassMismatch")]
    

    And make sure you’ve added your PassMismatch string to the resource file that is mapped to your strings resource type.

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

Sidebar

Related Questions

I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem to make work a resource file. This is my simple code
I have problem with this code..I want to extract data from flat file and
I have problem with code. I have written a function for extracting a parameter,
Have problem while getting data from Memcached on .NET MVC solution. I have this
I have problem with php's preg_match.I want to make something like this : When
I have problem in my PHP code. I'm trying to make internet shop and
I have problem like this https://dev.twitter.com/discussions/4563 if (webResponse.Headers[Content-Encoding] == gzip) { byte[] bytes =
I have problem with my code. I don't know what am I doing wrong.
I have problem with Activities navigation, searching works good. Activities hierarchy looks like that:

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.