pass value to controller by using ajax
<p>I want to pass value from view to controller by using ajax.</p>

<pre><code> &lt;button onclick="addCommentByAjax()" &gt;Save&lt;/button&gt;
</code></pre>

<blockquote>
  <p>My script:</p>
</blockquote>

<pre><code>function addCommentByAjax() {
    $.ajax({
        type: "POST",
        url: '/Survey/DoDetailSurvey',

        data: {
            choiceId: "1"
        }


});
}
</code></pre>

<blockquote>
  <p>Controller:</p>
</blockquote>

<pre><code> [HttpPost]
    public ActionResult DoDetailSurvey(SurveyViewModel model, string choiceId)
    {
     //
    }
</code></pre>

<blockquote>
  <p>but choiceId always null</p>
</blockquote>