Я хочу проверить, установлен ли флажок или нет из моего метода methion, мне нужно передать значение флажка из представления в контроллер
это мой взгляд
@using (Html.BeginForm("Index", "Graphe"))
{
<table style="width: 100%;" border="1">
<tbody>
<tr>
<td>Responsable:</td>
<td><select id="Responsables" name="responsables" ><option>Selectionnez --</option></select></td>
<td><input id="responsable" name="checkResp" type="checkbox" /> </td>
</tr>
<tr> <td><input type="submit" value="Afficher" id="ButtonSubmit"/></td>
<td><input class="button" id="ButtonReset" type="button" value="Annuler" /></td>
</tr>
</tbody>
и я попробую:
public ActionResult Index( string responsables, bool checkResp)
{
Highcharts chart = new Highcharts("chart");
if (responsables != null)
{
if (checkResp)
chart = Global();
else
chart = Resp(responsables);
}
else
chart = Global();
return View(chart);
}
но у меня есть эта ошибка:
Le dictionnaire de paramètres contient une entrée Null pour le paramètre "checkAct" de type non Nullable "System.Boolean" pour la méthode "System.Web.Mvc.ActionResult Index (System.String, System.String, Boolean)" dans "Project.Controllers.GrapheController". Un paramètre facultatif doit être un type référence, un type Nullable ou être déclaré en tant que paramètre facultatif. Nom du paramètre: параметры
Можете ли вы мне помочь?