我有局部视图,其中有2个导航选项卡。在每个标签上,我要根据国家/地区填充数据。
当前,我遇到以下错误:
堆栈不足,无法继续安全地执行程序。这个可以 发生于调用堆栈上的函数过多或 堆栈使用了过多的堆栈空间。
控制器
public ActionResult Index()
{
ClsHome model = new ClsHome();
return View(model);
}
public PartialViewResult EmployeeBasedCountry(int CountryId)
{
ClsHome clshome=new ClsHome();
clshome.Country = CountryId;
clshome.countries = CountryFilter(CountryId);
return PartialView("~/Views/Home/_pEmp.cshtml", clshome);
}
索引视图
@model EmpWebsite.Models.Home.ClsHome
<div class="col-md-5">
@Html.Partial("_pEmp")
</div>
局部视图
@model EmpWebsite.Models.Home.ClsHome
<ul class="nav nav-tabs nav-justified">
<li class="active"><a data-toggle="tab" href="#Tab1">India</a></li>
<li><a data-toggle="tab" href="#Tab2" style="width:auto">USA</a></li>
</ul>
<div class="tab-content">
<div id="Tab1" class="tab-pane fade">
@Html.Action("EmployeeBasedCountry", new { @CountryId = "1" })
<div class="panel">
<table class="table-striped">
<tr class="heading">
<th>
EmpId
</th>
<th>
EmpName
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@item.EmpId
</td>
<td>
<a>@item.EmpName</a>
</td>
</tr>
}
</table>
</div>
</div>
<div id="Tab2" class="tab-pane fade">
@Html.Action("EmployeeBasedCountry", new { @CountryId = "2" })
<div class="panel">
<table class="table-striped">
<tr class="heading">
<th>
EmpId
</th>
<th>
EmpName
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@item.EmpId
</td>
<td>
<a>@item.EmpName</a>
</td>
</tr>
}
</table>
</div>
</div>
</div>