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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:48:12+00:00 2026-06-14T11:48:12+00:00

I have a model that was auto-generated from my SQL database. class Organization {

  • 0

I have a model that was auto-generated from my SQL database.

class Organization
{
    public Organization()
    {
        this.ContactTitles = new HashSet<ContactTitle>();
        this.OrganizationAddresses = new HashSet<OrganizationAddress>();
        this.OrganizationBusinessTypes = new HashSet<OrganizationBusinessType>();
        this.OrganizationCountries = new HashSet<OrganizationCountry>();
        this.OrganizationEmails = new HashSet<OrganizationEmail>();
        this.OrganizationMemberships = new HashSet<OrganizationMembership>();
        this.OrganizationNotes = new HashSet<OrganizationNote>();
        this.OrganizationPhones = new HashSet<OrganizationPhone>();
        this.OrganizationWebsites = new HashSet<OrganizationWebsite>();
        this.Contacts = new HashSet<Contact>();
        this.OrganizationIndustryCodes = new HashSet<OrganizationIndustryCode>();
    }

    public int OrganizationID { get; set; }
    public string Name { get; set; }

    public virtual ICollection<ContactTitle> ContactTitles { get; set; }
    public virtual ICollection<OrganizationAddress> OrganizationAddresses { get; set; }
    public virtual ICollection<OrganizationBusinessType> OrganizationBusinessTypes { get; set; }
    public virtual ICollection<OrganizationCountry> OrganizationCountries { get; set; }
    public virtual ICollection<OrganizationEmail> OrganizationEmails { get; set; }
    public virtual ICollection<OrganizationMembership> OrganizationMemberships { get; set; }
    public virtual ICollection<OrganizationNote> OrganizationNotes { get; set; }
    public virtual ICollection<OrganizationPhone> OrganizationPhones { get; set; }
    public virtual ICollection<OrganizationWebsite> OrganizationWebsites { get; set; }
    public virtual ICollection<Contact> Contacts { get; set; }
    public virtual ICollection<OrganizationIndustryCode> OrganizationIndustryCodes { get; set; }
 }

In my Organization View, on my Index page – it is strongly typed to my Organization Model.

I am trying to displaying the Membership information, on the Organization index page, that I believe should be in the ICollection. Unless I am miss-interpreting what that does.

When I go to put a @Html.DisplayFor(modelItem => item.OrganizationMemberships. to grab the data in the OrganizationMembership table, it does not show up on IntelliSense. I only need to be able to display the data, I don’t have to submit any changes with a form.

  • 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-14T11:48:13+00:00Added an answer on June 14, 2026 at 11:48 am

    Since the model is an enumerable type — @model PagedList.IPagedList<VAGTC.Models.Organization> — you’ll need to iterate through them in your main view:

    @foreach (var organization in Model)
    {
        @Html.DisplayFor(model => organization)
    } 
    

    Next, create a display template for the class Organization. Under Views/Shared/DisplayTemplates add a view Organization.cshtml:

    @model VAGTC.Models.Organization
    

    Now this is the main view that renders your class. Here you can iterate over the membership items:

    @foreach (var membership in Model.OrganizationMemberships)
    {
        @Html.DisplayFor(model => membership)
    } 
    

    Now again, create a partial view for the OrganizationMembership class by adding OrganizationMembership.cshtml under Views/Shared/DisplayTemplates.

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

Sidebar

Related Questions

I have a Model that named word. this is my word model public class
i have my auto-generated linq to sql classes, and i extend this class using
I have a model that looks like: [Serializable] public class TemplatePageModel { public PageModel
I have a model that is something like this: class Input(models.Model): details = models.CharField(max_length=1000)
I am creating a linq-to-sql model with EF, and have a class that works
I have a model that looks like this: Performance - Location - Event -
I'm very new to Entity Framework, that's my disclaimer! I have a SQL 2008
I have an MVC 2 project where I recently consolidated the auto-generated membership/roles database
I have this service: public class AAAService extends Service { private Intent requestService; private
I have a model Articles that has_many Assets which is a polymorphic model 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.