title: How to make an Ajax Post Back with ASP.net MVC
body: <p>I am very new to MVC . So , have been studying the code of MusicStore Application in CodePlex.</p>
  
  <p>I am unable to understand what does the following code meant:</p>
  
  <pre><code> // AJAX: /ShoppingCart/RemoveFromCart/5
  
          [HttpPost]
          public ActionResult RemoveFromCart(int id)
          {
              // Remove the item from the cart
              var cart = ShoppingCart.GetCart(this.HttpContext);
  
              // Get the name of the album to display confirmation
              string albumName = storeDB.Carts
                  .Single(item =&gt; item.RecordId == id).Album.Title;
  
              // Remove from cart
              int itemCount = cart.RemoveFromCart(id);
  
              // Display the confirmation message
              var results = new ShoppingCartRemoveViewModel
              {
                  Message = Server.HtmlEncode(albumName) +
                      " has been removed from your shopping cart.",
                  CartTotal = cart.GetTotal(),
                  CartCount = cart.GetCount(),
                  ItemCount = itemCount,
                  DeleteId = id
              };
  
              return Json(results);
          }
  
          //
          // GET: /ShoppingCart/CartSummary
  
          [ChildActionOnly]
          public ActionResult CartSummary()
          {
              var cart = ShoppingCart.GetCart(this.HttpContext);
  
              ViewData["CartCount"] = cart.GetCount();
  
              return PartialView("CartSummary");
          }
      }
  }
  </code></pre>
  
  <p>Please help me clarify , how that particluar HttpPost works as a Ajax Post back .</p>