I have my main index page and I'm trying to render my partial view with the following code:
@{Html.RenderAction("PartialView", "PartialViewController");}
My Controller for it looks like this:
public ActionResult Index()
{
GetDataFromProc proc = new GetDataFromProc();
DataSet ds = proc.CallProcToDataSet("mySproc");
return PartialView(ds);
}
And my partial view is as follows:
@using System.Data
@model DataSet
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Year</th>
<th>Month</th>
<th>Hits</th>
</tr>
</thead>
<tbody>
@foreach (DataRow row in Model.Tables[0].Rows)
{
<tr>
<td>@row["_year"]</td>
<td>@row["_monthName"]</td>
<td>@row["_monthCount"]</td>
</tr>
}
</tbody>
</table>
</div>
Nothing overtly groundbreaking, but each time I run my project I get the following error message: The controller for path '/' was not found or does not implement IController
Clearly I'm doing something wrong, could someone please tell me the standard way for rendering a partial view with an associated controller?
public IActionResult Index() {?