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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:38:01+00:00 2026-05-24T16:38:01+00:00

I am new to MVC and MVC3 and developing a new application to learn

  • 0

I am new to MVC and MVC3 and developing a new application to learn how it works. Mirroring our production environments, it would have several tables with FK relations.

We give the users the ability to maintin the master data.

I have two master tables, Locations and Departments. Since a department can belong to one location, a location FK is put in the department table:

Public Class Location
   Public Property LocationID() As Integer
   Public Property LocationName() As String
   Public Property LocationActive() as Boolean
End Class

Public Class Department
   Public Property DepartmentID() As Integer
   Public Property LocationID() As Integer
   Public Property DepartmentNumber() as Integer
   Public Property DepartmentName() as String
   Public Property DepartmentActive() As Boolean

   Public Overridable Property Location as Location
End Class

When viewing or editing departments, how do I show a list of location names instead of requiring the ID?

  • 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-05-24T16:38:02+00:00Added an answer on May 24, 2026 at 4:38 pm

    You use a combo box that is bound to the LocationId of Department but the corresponding SelectList is populated from the Location table.

    You can either pass a list of locations to the view via the model, or use a bespoke Helper method to build the select list.

    For display, if you don’t want to use a disabled combo box, write a helper method that takes the Id and returns the LocationName.

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

Sidebar

Related Questions

I am developing an MVC3 application using Visual Studio 2010. I have an aspx
I have a new MVC3 application with a few legacy Web Form pages. I'm
I am developing one new area of a fairly large web application using MVC3
Hello i am currently developing a ASP.NET MVC 3 application that uses the new
I have started a new mvc project and clicked on project\properties\web - use local
I've just create a new MVC project, and have made no changes at all,
Basically what the title says. I created a new MVC application. I'm trying to
I am building an MVC-based e-commerce application with MVC3 based on nopCommerce. I am
I am completely new to ASP.Net MVC. I just created an MVC3 project in
I'm deploying an MVC3 application to a new server. The application runs fine on

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.