title: @Ajax.ActionLink - passing value of text-area to controller, and a data-something attribute
body: <p>This is the story: </p>
  
  <p>I am making a commenting system, and when a user wants to add a comment they need to put data in a text area. I want to take that value typed by the user and make an @Ajax link which is to send that as a parameter to a controller.</p>
  
  <p>I am using ASP.NET MVC5, and in my View() I have the following:</p>
  
  <pre><code>&lt;textarea class="textArea" rows="3"&gt;&lt;/textarea&gt;
          &lt;br /&gt;
          @Ajax.ActionLink("Send",
                           "AddComment",
                           new { parametar = 0 , Contents = GetText() },
                           new AjaxOptions
                           {
                              UpdateTargetId = "beforeThis",
                              InsertionMode = InsertionMode.InsertBefore,
                              HttpMethod = "GET"
                           },
                           new { @class = "postavi btn btn-primary" })
  </code></pre>
  
  <p>I tried inserting under this the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function GetText() {
          return "hello there!";
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have in error saying that:</p>
  
  <p><strong>the name GetText does not exists in the current Context</strong>
  (this is in the parameters of the @Ajax.ActionLink)</p>
  
  <p>It seems I cannot integrate javascript (which could fetch me this value and razor code) How do I work this out???
  PS> I have searched around for this, and either the answers for much earlier versions of MVC or the answers did not worked when I tried the same.</p>