Build an ActionLink with a Value from the Page
Normally I would use an Html.BeginForm and wrap my link inside it to force it to the controller to handle any variables, but every so often you may need to add a link on the page which is populated with a variable from a textbox and you choose not to post back to the controller. In this example I want to pass an account number in my ActionLink So I start by adding the textbox on the page Enter Account Number: @Html.TextBox("account") And the Actionlink (using some bootstrap formatting) @Html.ActionLink("View", "Customer", null, new { id = "View", @class="btn btn-danger" }) Then I handle the click event in script on the page <script> $(function () { $('#View').click(function () { var fran = $('#account').val(); this.href = this.href + '?id=' + encodeURIComponent(fran); }); }); <...