Я использую нумерацию страниц на стороне сервера в datatable, но происходит ошибка. Ipagedlist не содержит определения для столбцов и строк.Требуется помощь, следующий мой код
@model PagedList.IPagedList<System.Data.DataTable>
<div class="panel-body">
<table id="table" class="table table-condensed table-bordered table-hover table-responsive table-striped">
<thead>
<tr>
@foreach (DataColumn col in Model.Columns)
{
if (col.ColumnName != "Invoice" && col.ColumnName != "Tax")
{
<th>@col.ColumnName</th>
}
}
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach (DataRow dr in Model.Rows)
{
<tr>
@foreach (DataColumn dc in Model.Columns)
{
if (dc.ToString() != "Invoice" && dc.ToString() != "Tax")
{
<td>
@if (dc.ToString() == "Created Date")
{
string s = String.Format("{0:dd-MM-yyyy}", @dr[dc.ColumnName]);
@s;
}
else
{
if (dc.ToString() == "Amount")
{
string s = String.Format("{0:F2}", @dr[dc.ColumnName]);
@s
}
else
{
@dr[dc.ColumnName]
}
}
</td>
}
}
<td>
@Html.ActionLink("Edit", "Edit", new { id = @dr["Order Id"] }, new { @class = "btn-sm btn-primary" })
@Html.ActionLink("Details", "OrderDetails", new { id = @dr["Order Id"] }, new { @class = "btn-sm btn-info" })
@{
if ((dr["Invoice"]).ToString() == "1")
{
@Html.ActionLink("Invoice", "ViewInvoice", new { id = @dr["Order Id"] }, new { @class = "btn-sm btn-success", @target = "_blank" })
}
else
{
@Html.ActionLink("Invoice", "ViewInvoice", new { id = 0 }, new { @class = "btn-sm btn-default", @onclick = "javascript:return false;" })
}
}
</td>
</tr>
}
</tbody>
</table>