Передайте значения checkBox в действие контроллера в asp.net mvc4

Я хочу проверить, установлен ли флажок или нет из моего acion метона, что мне нужно, чтобы передать значение флажка из представления в контроллер

это мой взгляд

   @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);

    }

, но у меня есть эта ошибка:

Словарь терминов contient un entrée Null для параметра «checkAct» типа Nullable «System.Boolean» для метода «System.Web.Mvc.ActionResult Index (System.String, System.String, Boolean)» dans «Project .Controllers.GrapheController ». Un paramèt facultatif do untére référence, un type Nullable ou étre déclaré en tant que paramèt facultatif. Nom du paramètre: параметры

Не могли бы вы мне помочь !

Ответы на вопрос(11)

Ваш ответ на вопрос