title: How to call jquery function from @Html.ActionLink param routeValues
body: <p>I have a text box and a button upon clicking which should retrieve the value set in the text box and pass it to a controller. I am trying to do this by calling a JQuery function which returns me the value of text box and pass as routevalues parameter. I know this does not work, but my question is there a way to modify the below code to achieve this? Basically i want to know how can I plug getValue function inside ActionLink call.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function () {
  
      var getValue = function () {
  
          return $("#addtoset").val();
      };
  });
  &lt;/script&gt;
  
  @Html.TextBox("addtoset", "", htmlAttributes : new { @id = "addtoset", @class = "col-sm-10" })
  @Html.ActionLink("Add To Set", "AddToSet", routeValues: new { amount = getValue()}, htmlAttributes : new { @id="linkSet", @class = "col-sm-2" }) 
  </code></pre>