title: Am I using HttpGet and HttpPost wrong? ASP.NET C#
body: <p>Code:</p>
  
  <pre><code>[HttpPost]
  public ActionResult DeleteProduct(int ProductID, string Name, decimal Price, string Photo, int Likes, string Description, Enums.ProductCategory.Category Category) 
  {
      ProductModel productModel = new ProductModel
      {
          ProductID = ProductID,
          Name = Name,
          Price = Price,
          Photo = Photo,
          Likes = Likes,
          Description = Description,
          Category = Category
      };
      return View(productModel); 
  }
  [HttpGet]
  public ActionResult DeleteProduct(int ProductID)
  {
      if(UserController.userSessionID != 0)
      {
          user.DeleteProduct(ProductID);
          return RedirectToAction("ViewSellerProducts", "Product");
      }
      return View();
  }
  </code></pre>
  
  <p>But I read HttpGet is only supossed to get data and do nothing else, which <code>[HttpGet]DeleteProduct()</code> isn't doing. The fact is, if I would change <code>DeleteProduct()</code> to <code>[HttpPost]</code> the ID would be 0, so how would I get the ID in the view?</p>
  
  <p>When the products are set on page:
  <a href="https://i.stack.imgur.com/BjpR3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BjpR3.png" alt="enter image description here"></a></p>
  
  <p>When I'm on the page that shows all the details and I have to click on delete:</p>
  
  <p><a href="https://i.stack.imgur.com/MXeUh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MXeUh.png" alt="enter image description here"></a></p>