title: How to get the textbox changed value for Update in @Html.ActionLink in MVC
body: <p>I am trying to get the textchanged value from textbox to update in my Controller.<br/>
  View</p>
  
  <pre><code>  @Html.TextBox("Quantity", item.Quantity)
  
    &lt;a  href="@Url.Action("Update", "Shopping", new { id = Request.QueryString["UserID"], productid = item.ProductID, qty ="Quantity", unitrate = item.Rate })"&gt;     
  &lt;img alt="updateitem" style="vertical-align: middle;" height="17px" src="~/Images/product_updates_image.png"
   title="update" id="imgUpdate" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>And in My Controller with Update </p>
  
  <pre><code> public ActionResult Update(string id, string productid, int qty, decimal unitrate)
          {
              if (ModelState.IsValid)
              {
                  int _records = UpdatePrice(id,productid,qty,unitrate);
                  if (_records &gt; 0)
                  {
                      return RedirectToAction("Index1", "Shopping");
                  }
                  else
                  {
                      ModelState.AddModelError("","Can Not Update");
                  }
              }
              return View("Index1");
          }
  </code></pre>
  
  <p>Update Function </p>
  
  <pre><code>public int UpdatePrice(string id,string productid, int qty, decimal unitrate)
      {
          con.Open();        
          var total = qty * unitrate;
          SqlCommand cmd = new SqlCommand("Update [Cpecial_Shopping_Cart_tbl] Set Price='"+ total +"' where [User ID]='" + id + "' and [Product ID]='" + productid + "'", con);
          cmd.Parameters.AddWithValue("@total", total);
          return cmd.ExecuteNonQuery();
      }
  </code></pre>
  
  <p>I passed the Textbox name for the quantity variable in <code>@Html.ActionLink</code>. But when the text box value is changed, value is not passed in it. </p>
  
  <p>EDIT :</p>
  
  <p>Initially the value for the textbox from DB is 1. When I change the textbox value, its not getting updated and the same value is updated even when the form is posted.</p>