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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:26:00+00:00 2026-06-04T10:26:00+00:00

I’m looking for a good solution for the following problem: I have a ASP.NET

  • 0

I’m looking for a good solution for the following problem:

I have a ASP.NET MVC Webapplication, used by several of my Clients. Within the application, a client can login, view several pages with information and fill in several forms. This all works great.

What I want however, is to show different texts in the view, depending on a property of the Client (A type in this case). These texts can be multi-lingual, the user can change the language in the application.

I’ve come up with several solutions for this, but I’m not sure what the best idea is. These are my ideas so far:

Saving info in database

In this case, I would create a table (e.g. ‘ProgramTexts’), with a Key, the type of the client, the language and the text it self. In my Controller, I would then retrieve the Keys used in that view, set them in a ViewModel and pass that viewmodel to the view. In the view I can then easily show the value of the given variable in the ViewModel.

I think this will work great for a small sites, but seems a bit chunky with many different controllers and views. I’d rather ‘call’ the text directly from the view, but making a database call from the view isn’t much better.

Resource files

My other idea would be using Resource Files, because of the build in Localization feature. I’m not sure however how to retrieve a variable from a resource, based on a extra variable (the type in this case).

Does anyone have another idea about how to achieve this?

  • 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-04T10:26:02+00:00Added an answer on June 4, 2026 at 10:26 am

    I would go for the resource file option. Is it possible to have different resource files for the types? Or is it possible to have different variable names for the different types?

    eg

    Message1_TypeA
    Message2_TypeB
    

    etc

    Then you could use some clever tricks to read the correct message depending on type, a clever trick such as reflection perhaps.

    Another option might be to delimit the string thus

    Message1 = “A|B|C|D”;

    This way you retrieve the message for all types and then in your code you can retrieve the correct message for the current type. Did I explain that well? I don’t think I did.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.