I saved a list in ViewBag.FY from the controller. During debugging it it is showing data in the ViewBag.
When I am printing the data in the view, it is not printing data.
Here is the code:
@model IEnumerable<MVC4_Theming.HRMS_Tax>
@{
ViewBag.Title = "Index";
var taxSlabsByFinancialYear = ViewBag.FY;
}
<div class="table table-responsive">
<table id="example" class="table table-hover table-striped table-bordered" cellspacing="0">
<thead>
<tr>
<th>No#</th>
<th>Name</th>
<th>Min-Range</th>
<th>Max-Range</th>
<th>Annual-Range</th>
<th>Fix-Amount</th>
<th>(%)-Amount</th>
<th>Year-Slab</th>
<th>IsActive</th>
<th>Action</th>
</tr>
@{
if (ViewBag.FY == null)
{
<p>Please Select Financial Year</p>
}
else
{
int a = 0;
foreach (var item in ViewBag.FY)
{
a++;
<tr>
<td>@a</td>
<td>@item.Name</td>
<td>@item.MinAmountRang</td>
<td>@item.MaxAmountRang</td>
<td>@item.Anuual_Amount</td>
<td>@item.Fix_Amount</td>
<td>@item.Percentage_Amount</td>
</tr>
}
}
}
</thread>
</table>
</div>
</div>
</div>
</div>
Please help me - who knows an answer to this problem?
Thanks in advance
