title: MVC radiobutton didn't call ActionResult
body: <p>I'm trying to call ActionResult by using JQuery. And doing something wrong, because query starts, but ActionResult in controller - not. Also I need to send value of checked radiobutton in it.</p>
  
  <p>JQuery:</p>
  
  <pre><code>    $("#allRows").on("change", function () {
          var url = '@Url.Action("Index", "OrderManagment")';
  
          if ($("#allRows").attr("checked") === "checked") {
              $.post(url, { 'tableRows': $("#allRows").val() });
          }
      });
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>        [HttpPost]
          [ValidateAntiForgeryToken]
          public IActionResult Index( string tableRows )
          {
              //some code
  
              if (tableRows == "all")
              {
                  return View(orders.ToList());
              }
              else
              {
                  var rows = Int32.Parse(_context.Settings.FirstOrDefault().Value);
                  return View(orders.ToList().Take(rows));
              }
          }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;form asp-action="Index"&gt;
   &lt;div  style="text-align: right;"&gt;
          &lt;label&gt; Select count of rows in the table&lt;/label&gt;
          &lt;label&gt;&lt;input type="radio" id="allRows" name="tableRows" value="all"&gt; All&lt;/label&gt;
          &lt;label&gt;&lt;input type="radio" id="settings" name="tableRows" value="settings" checked/&gt; Settings &lt;/label&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>