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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:31:35+00:00 2026-05-30T11:31:35+00:00

I think it’s something basic yet I can’t figure it out. Would appreciate some

  • 0

I think it’s something basic yet I can’t figure it out. Would appreciate some help.

Lets say we have two tables: Tv and Shows.
Shows are connected to Tv table by a TvId field.

Now in our MVC application we obviously have the models to match the two tables.
Now… I need to add a new Show !

I go to a web form, select one of the Tvs and want to add a show.

When I”m on the “New show” form that uses a Shows model.. how can I get access and pass the TvId that this show’s going to be created for ?

I bound all data fields to the Show model but can’t figure out how to connect a new show to its “Tv”.

  • 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-30T11:31:36+00:00Added an answer on May 30, 2026 at 11:31 am

    In your controller, you could do something like create a new model called ShowWithTv – something like this:

    public class ShowWithTv {
        public Show { get; set; }
        public TV { get; set; }
    }
    
    public ActionResult Index(int ID) {
        var data = new ShowWithTV();
        data.Show = new Show();
        data.TV = new TV().LoadFromId(ID) // put code here to load TV from ID
        return View(data);
    }
    

    Then populate this with the Show details (probably blank, but might have default values), and the TV.

    Then in your view change the “Inherits” at the top to be your new ShowWithTv model.

    Then you will have access in the view to do this:
    Model.TV.{property here}

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

Sidebar

Related Questions

Think 2 entities OneToOne mapped. Person and Car. A Person can have a Car.
I think I'm missing something basic here. Why is the third IF condition true?
I think I'm missing something basic here. Any explanation or pointers to previously asked
Think I have domain.com that redirects into some.otherdomain.com . I don't want to show
think about having a skript where you have some words as input. now you
I think it can be done by applying the transformation matrix of the scenegraph
I think I've got it down to the most basic case: int main(int argc,
I think I have found a bug when setting or getting the Me.Top property
I think firefox's support to box model in CSS3 is soooooooooooooo poor... I have
Think about the classic installation process, where you have a next button and when

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.