I've a table/model structure similar to following where parent table PT has two children tables C1 and C2 both of which have different columns except a FK column pointing to PK column. I need to display a View with data in two HTML tables for each of the children tables. How can I achieve this? The problem is on how to pass two models (one for each partial view) from the same action method. Each partial view has one single record to display. Note: I can display each partial view in two different views each having its own model. But how to achieve the above?
Parent table PT columns: PK_col, col1, col2
Child table C1 columns: FK_col, col3, col4
Child table C2 columns: FK_col, col5, col6
View:
...
@Html.Partial("PartialVW_1")
...
@Html.Partial("PartialVW_2")
....
PTand then@Html.Partial("PartialVW_1", Model.C1)and@Html.Partial("PartialVW_2", Model.C2)- user3559349Model.C1will automatically pick the child attributes because of the FK relationship correct? - namPTin the GET method correctly - user3559349PTload correctly becauseModel.C1is always null even though in Db it does have data. So, I've created another post for this issue. - nam