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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:47:30+00:00 2026-06-06T02:47:30+00:00

I am developing my first ASP.Net MVC 3 web application against a SQL Server

  • 0

I am developing my first ASP.Net MVC 3 web application against a SQL Server Database. I used Database First to create the dbContext and Models from an existing database.

I am trying to create a master/detail view of 1-M relationships. I have TableA which is related to TableB and TableC each with a 1-M relationship. but TableB and TableC are not directly related to each other.

When the user goes to the Details view of a record from TableA, I would like it to show a section at the top of the view with data from the columns within TableA. Then below I would like to have a group of tabs with one tab for each related table (TableB and TableC). When the user clicks on the TableB tab for example, I would like to load a partial view listing all the related records in TableB.

Can someone help me figure out how accomplish this? I would post code, but I’m not really sure where to begin.

I have done some research and found a lot of posts discussing ViewModels, but I’m not sure how this would differ from my TableA Model, which includes the related collections for TableB and TableC. I also have discovered how to load the records from each relationship into different tables within the TableA Details view, but this does not include the tabbing functionality I need.

Thanks in advance.

  • 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-06T02:47:32+00:00Added an answer on June 6, 2026 at 2:47 am

    I ended up creating partial views for each child table and using an AJAX ActionLink to load the partial view based on the tabs.

    Part of TableA view (Master):

    <div>
        <nav>
            <ul id="menu">
                <li>@Ajax.ActionLink("TableB", "TableATableBList", "TableB", New With {.id = Model.TableAID}, New AjaxOptions With {.UpdateTargetId = "partial-div"})</li>
                <li>@Ajax.ActionLink("TableC", "TableATableCList", "TableC", New With {.id = Model.TableAID}, New AjaxOptions With {.UpdateTargetId = "partial-div"})</li>
            </ul>
        </nav>
        <section>
            <div id="partial-div">
            </div>
        </section>
    </div>
    

    TableB Controller:

    Public Class FlightlineController
            Inherits System.Web.Mvc.Controller
    
            Private db As MyEntities = New MyEntities
    
            '
            ' GET: /TableB/
    
            Function Index() As ViewResult
                Dim tableBs = db.TableBs.Include(Function(b) b.TableA)
                Return View(tableBs.ToList())
            End Function
    
            Function TableATableBList(ByVal id As Guid) As PartialViewResult
                Dim tableA As TableA = db.TableAs.Find(id)
                Return PartialView("TableBList", tableA.TableBs.ToList())
            End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing my first web application using ASP.Net MVC, and I am in
I'm developing a web application based on ASP.NET MVC. There are a large database.
I'm developing a web application using ASP.NET MVC 3 and Entity Framework Code First
I am developing an asp.net mvc 2 web application. My clients will most likely
I'm developing a web application using asp.net Mvc 2 and NHibernate, and I'm paging
I'm developing a web application with asp.net mvc 3 and DDD. For my domain
we are developing ASP.NET web application with cEF ode first. What/Where is the best
I'm developing my first ASP.NET MVC 3 application and have a couple of jqGrid
I'm developing my first ASP.NET MVC application. This application tracks events, users, donors, etc.
I've recently started developing my first serious application which uses a SQL database, and

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.