title: How to get {ID} in url "controller/action/id" in a post action?
body: <p>In the cshtml file, I have the following javascript in <code>Home/Details/4</code>. 4 is the ID.</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $("#checkbox").click(function () {
              $.post(
                  "Home/Toggle", 
                  { checkbox: $("#checkbox").val() }, 
                  function (data) {
  
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The following is the action code in the controller.</p>
  
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Toggle(bool checkbox)
      {
          ...... // How to get ID?
          var x = db.XXXX.Find(id);
  </code></pre>
  
  <p>How to get the ID? From some routing data, or Url, or let the front jQuery posting pass it?</p>
  
  <p><strong>Is it possible to get the ID from the action method without passing from the front html page?</strong></p>