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 8051503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:19:03+00:00 2026-06-05T07:19:03+00:00

I am working on .NET 4.0 MVC3 web application. The application is all in

  • 0

I am working on .NET 4.0 MVC3 web application. The application is all in English and allows users to fill information regarding different regions. For simplicity let’s say we have two regions: United States and Western Europe.

Now in the view I present a string let’s say Project opening, but if the user works on region United States I would like it to read Project initiation.

When I think about this functionality I immediately think about resource files for different regions, but independent from the UI culture.

Does anyone have a recipe how to achieve what I want?

Would be also nice, if in the future I could make it read e.g. ExtendedDisplayAttribute(string displayName, int regionId) placed over properties of my ViewModels.

EDIT

I am already at the stage where I can access region information in a helper that should return the string for this region. Now I have a problem with the resource files. I want to create multiple resource files with failover mechanism. I expected there would be something working out of the box, but the ResourceManager cannot be used to read resx files.

Is there any technique that will allow me to read the values from specific resource files without some non-sense resgen.exe?

I also do not want to use System.Resources.ResXResourceReader, because it belongs to System.Windows.Forms.dll and this is a Web app.

  • 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-05T07:19:05+00:00Added an answer on June 5, 2026 at 7:19 am

    Just in case someone wants to do the same in the future. This article turned out to be really helpful: http://www.jelovic.com/articles/resources_in_visual_studio.htm

    The piece of code that I use (VB) is:

    <Extension()>
    Public Function Resource(Of TModel)(ByVal htmlHelper As HtmlHelper(Of TModel), resourceKey As String) As MvcHtmlString
        Dim regionLocator As IRegionLocator = DependencyResolver.Current.GetService(GetType(IRegionLocator))
    
        Dim resources = New List(Of String)
        If Not String.IsNullOrEmpty(regionLocator.RegionName) Then
            resources.Add(String.Format("Website.Resources.{0}", regionLocator.RegionName))
        End If
        resources.Add("Website.Resources")
    
        Dim value = String.Empty
        For Each r In resources
            Dim rManager = New System.Resources.ResourceManager(r, System.Reflection.Assembly.GetExecutingAssembly())
            rManager.IgnoreCase = True
    
            Try
                value = rManager.GetString(resourceKey)
                If Not String.IsNullOrEmpty(value) Then
                    Exit For
                End If
            Catch
    
            End Try
        Next
    
        Return New MvcHtmlString(value)
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on ASP.net MVC3 Web application on a dedicated Windows Server 2k8 running
I'm working on ASP.net MVC3 Web application that is facing scalability issue. For improving
I'm working on Asp.net MVC3 web application. I'm having one page on which appx.
I'm working on a web application project using ASP.NET MVC3 and database in SQL
I have Ninject working nicely in an ASP.NET MVC3 web application. I'd like to
I'm working on a ASP.NET MVC3 web application and I want to create a
I have been working on ASP.net MVC3 Web application using MSSQL 2008 R2 for
I am working on ASP.NET 4.0 MVC3 web application that works in intranet environment.
I am working on a web application (asp.net mvc3) I have a Main div.
I developed an ASP.NET MVC 3 web application and it's working correctly locally, but

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.