I have a partial view that is called _GetForfaitDashBoard.cshtml This is the code
@model WebAppComp.Areas.Admin.Models.StatsForfaitDashBoard
<table class ="table table-bordered">
<tr>
<th>Nombre total de Forfaits</th>
<th>Moyenne des forfaits par Agence</th>
<th>Forfait Ayant le prix le plus haut</th>
<th>Forfait Ayant le prix le plus bas</th>
<th>Le forfait le plus visité</th>
<th>Le forfait le mieux noté par les membres</th>
<th>le forfait ayant le plus de réservations</th>
<th>le forfait le plus récent</th>
</tr>
<tr>
<td>@Model.CountForfaits</td>
<td>@Model.AverageCountForfaitPerAgence</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdHighestPriceForfait }, null)</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdLowestPriceForfait }, null)</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdMostVisitedForfait }, null)</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdBestRatedForfait }, null)</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdMostBookedForfait}, null)</td>
<td>@Html.ActionLink("Ici", "GetById", "Agence", new { numSiretAgence = Model.IdMostRecentForfait}, null)</td>
</tr>
</table>
It's a table in which I put statistics. What I want to do is to have these statistics loaded in a web page based on a Form , the form will contain a simple dropdownlist in which the user choses the type of statistics that he wants. Here is the code of the partial View Action :
[HttpPost]
public PartialViewResult _GetForfaitDashBoard (TypeForfait typeForfait)
{
.....
}
Now I don't know how to do to put all I said into action. Is putting a form in the base view that posts to the action of the Partial View will be a good approach? Or is there any other solutions to call a partial view based on a form?