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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:42:42+00:00 2026-06-13T18:42:42+00:00

We are working on an MVC website where some list have user and system

  • 0

We are working on an MVC website where some list have user and system values. So, system items need to be internationalized to display in the user language, and user items are already in the user language.

Those system items have a flag called “IsSystem” to differenciate the ones we need to internationalize. This flag also mean that the user cannot update or delete those items.

Well, we are using @Html.DropDownList to render this DropDownList… so I don’t find how to step in the middle of dropdownlist loading logic… in order to place an if statement checking for the IsSystem flag and getting the correct text from resource files.

Thanks for any idea on how to handle this…

EDIT:

Controller code:

ViewBag.idTaskType = new SelectList(db.TaskTypes, "idTaskType", "Name");

where db is Context from EntityFramework

View Code:

@Html.DropDownList("idTaskType", String.Empty)
  • 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-13T18:42:43+00:00Added an answer on June 13, 2026 at 6:42 pm

    I am imagining your “TaskTypes” tables as below

    idTaskType  Name
    ----------  -----
    1           Task1
    2           Task2
    3           Task3
    

    Let us consider two different “App_GlobalResources”

    [1]en-US

    Name    Value
    ----    -----
    Task1   Create  
    Task2   Update
    Task3   Delete
    

    [1]sv

    Name    Value
    ----    -----
    Task1   Skapa
    Task2   Uppdatera
    Task3   Ta bort
    

    Now develop a IEnumerable SelectListItem

    public IEnumerable<SelectListItem> TaskTypeList { 
            get{
                List<TaskTypes> List = db.TaskTypes.ToList();
                return List.Distinct().OrderBy(x => x.Name).Select(x => new SelectListItem
                        {
                            Value = x.idTaskType.ToString(), 
                            Text = (HttpContext.GetGlobalResourceObject("Task", x.Name)).ToString()
                        });
            } 
        }
    

    Finally use

    @Html.DropDownList("idTaskType", new SelectList(Model.TaskTypeList, "Value", "Text"), String.Empty)
    

    Thanks.

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

Sidebar

Related Questions

I have a website using ASP.NET MVC, everything was working fine, but I'd like
I am working on a website and we will need to send the user
I am working on a website (Asp.net mvc), where I have multiple partial views.
I'm working on a MVC based web app on LAMP that needs some records
I am working with couple of friends on an ASP.NET MVC website. The project
I'm currently working on my own PHP Framework, and I need some help figuring
I am working on an ASP.Net MVC website and I am stuck on a
The website I'm working on has some fairly complicated routing structures and we're experiencing
I have been working with ASP.NET MVC for a couple of months now and
I am working on having the following functionality for my mvc website. I want

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.