Asp.net mvc 在单个视图中显示来自单个模型类中多个模型的多个表数据
我想从一个视图中的多个表中获取数据,并将其显示在不同的分隔符中,但我怎么做我不知道,请给我答复Asp.net mvc 在单个视图中显示来自单个模型类中多个模型的多个表数据,asp.net-mvc,Asp.net Mvc,我想从一个视图中的多个表中获取数据,并将其显示在不同的分隔符中,但我怎么做我不知道,请给我答复 @using _5Oppertunities.org.Models @model ViewmodelForJobandEducation <div> <table class="table table-responsive table-striped table-hover"> <thead
@using _5Oppertunities.org.Models
@model ViewmodelForJobandEducation
<div>
<table class="table table-responsive table-striped table-hover">
<thead class="thead-inverse">
<tr>
<th>#</th>
<th class="degtd">ja</th>
<th>Title</th>
<th>year</th>
<th class="tdinst">Institution</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td class="degtd">Mark</td>
<td>Otto</td>
<td>mdo</td>
<td class="tdinst">mdo</td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-edit"></span></a></td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
<tr>
<th scope="row">2</th>
<td class="degtd">Jacob</td>
<td>Thornton</td>
<td>fat</td>
<td class="tdinst">mdo</td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-edit"></span></a></td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
<tr>
<th scope="row">3</th>
<td class="degtd">Larry</td>
<td>the Bird</td>
<td>twitter</td>
<td class="tdinst">mdo</td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-edit"></span></a></td>
<td class="tdsp"><a href="#"> <span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
</tbody>
</table>
</div>
@使用_5opperunities.org.Models
@工作和教育的模型视图模型
#
青年成就组织
标题
年
机构
1.
做记号
奥托
mdo
mdo
2.
雅各布
桑顿
脂肪
mdo
3.
拉里
鸟
啁啾
mdo
我想在这里展示,我使用这个类来查看数据
public class ViewmodelForJobandEducation
{
public IEnumerable<CandidateInformation> CandidateInformation { get; set; }
public IEnumerable<EducationInformation> EducationInformaation { get; set; }
public IEnumerable<JobHistory> JobHistroy { get; set; }
}
job和education的公共类视图模型
{
公共IEnumerable候选信息{get;set;}
公共IEnumerable教育信息{get;set;}
公共IEnumerable作业历史{get;set;}
}
我从这个类中获取数据并显示数据 在cshtml页面中使用@foreach循环,并在其中检索所有Ienumerable列表