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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:04:40+00:00 2026-05-25T13:04:40+00:00

I followed a Tutorial a few weeks ago which shows how to create a

  • 0

I followed a Tutorial a few weeks ago which shows how to create a simple ASP.NET MVC 3 App (http://www.asp.net/mvc/tutorials/mvc-music-store-part-1).
Now I created another app that is actually doing something very simple, but I cant make Visual Studio 2010 automatically creating a View that shows a selection of the 1:n connection.
The program is a simple News system with a relation NewsEntry.NewsCategory to NewsCategory.ID.

NewsEntry.cs

public class NewsEntry
{
    public int ID { get; set; }
    public string Title { get; set; }
    public string ShortText { get; set; }
    public string Text { get; set; }
    public DateTime PublishDate { get; set; }
    public DateTime UnpublishDate { get; set; }
    public NewsCategory NewsCategory { get; set; }
}

NewsDB.cs

public class NewsCategory
{
    public int ID { get; set; }
    public string Name { get; set; }
    public List<NewsEntry> News { get; set; }
}

NewsDB.cs

public class NewsDB : DbContext
{
    public DbSet<NewsEntry> NewsEntry { get; set; }
    public DbSet<NewsCategory> NewsCategory { get; set; }
}

So my question is what is missing that VS is not creating a view with category in a drop down list?

  • 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-25T13:04:40+00:00Added an answer on May 25, 2026 at 1:04 pm

    It obviously helped to add a NewsCategoryId field:

    public class NewsEntry
    {
        public int NewsEntryId { get; set; }
        public string Title { get; set; }
        public string ShortText { get; set; }
        public string Text { get; set; }
        public DateTime PublishDate { get; set; }
        public DateTime UnpublishDate { get; set; }
        public int NewsCategoryId { get; set; }
        public virtual NewsCategory NewsCategory { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I followed the tutorial from this site: http://theappleblog.com/2008/08/04/tutorial-build-a-simple-rss-reader-for-iphone/ to make my first iPhone application,
I am trying to setup SSL to my web app and followed tutorial (http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/),
I followed the Tutorial in Cocoa Programming For Mac OS X to create a
I've followed this tutorial: http://anandhansubbiah.com/blog/writing-your-first-android-application/ , but no matter what I do, and what
I followed the RailsCasts tutorial to do a simple search with autocomplete, but it
I am stuck on this Spring MVC tutorial for newbies: http://sites.google.com/site/springmvcnetbeans/step-by-step/ I am the
I followed this tutorial: http://codeigniter.com/wiki/Internationalization_and_the_Template_Parser_Class/ The controller that loads the language is this one:
I followed tutorial from cocos2d official site . I try to create some items
I followed this tutorial in order to create a jQuery Horizontal Accordion. It works

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.