title: pass value of a textbox from view to controller using actionlink
body: <p>In my form I have a textbox as below</p>
  
  <pre><code>@Html.TextBox("first_name")
  </code></pre>
  
  <p>I need to pass the value of this textbox to controller through a actionlink.</p>
  
  <p>I tried the below </p>
  
  <pre><code>@Html.ActionLink("View", "view_Details", new { name = first_name})
  </code></pre>
  
  <p>but this is giving error </p>
  
  <blockquote>
    <p>"first_name" does not exist in the current context</p>
  </blockquote>
  
  <p>Is this possible using a Actionlink?</p>
  
  <p>My controller signature is </p>
  
  <pre><code>public ActionResult view_Details(string name)
       {
              return View();
       }
  </code></pre>
  
  <p><strong>Edited</strong></p>
  
  <pre><code> @Html.ActionLink("View", "view_Details", new { name = getname()})
  
   &lt;script type="text/javascript"&gt;
        function getname() {
             return $("#first_name").val();
         }
  &lt;/script&gt;
  </code></pre>
  
  <p>I tried above code. Its also giving error</p>
  
  <blockquote>
    <p>getname() does not exist in the current context</p>
  </blockquote>