passing parameter in ajax gets null value
<p>I'm calling an action controller using ajax but the parameter I'm passing with the <code>data</code> attribute is always null when the action controller receives it...
What could be happening in here?</p>

<p>JQuery function:</p>

<pre><code>function PostOrder()
{      
    var id = $(".aslink").data("customerid");
    var url = $("#btnAddOrderPost").data("url_add_order");       
    $.ajax({
        type:"post",
        url: url,
        data: JSON.stringify( { orderVM: $("#frmCreatePV").serialize()}),
        datatype: "json",
        contentType: "application/json",
        success: function () {
            alert("it was inserted");
        }
    })
}
</code></pre>

<p>Action controller:</p>

<pre><code>[HttpPost]
   // [ValidateAntiForgeryToken]
    public ActionResult CreatePV(OrderVM orderVM)
    {
        if (ModelState.IsValid)
        {
            List&lt;string&gt; top = new List&lt;string&gt;();
            decimal tempPrice = 0M;
            for (int i = 0; i &lt; orderVM.Toppings.Count; i++)
            {
                if (orderVM.Toppings[i].IsSelected == true)
                {
                    top.Add(orderVM.Toppings[i].SpecificTopping);
                    tempPrice += orderVM.Toppings[i].Price;
                }
            }
            Order order = new Order
            {                 
                Toppings = top,
                TotalPrice = tempPrice
            };
            db.Orders.Add(order);
            db.SaveChanges();
            return RedirectToAction("Index");
        }            
        return View(orderVM);
    }
</code></pre>

<p>This is the OrderVM ViewModel I'm using a parameter of this type:</p>

<pre><code>public class OrderVM
{           
    public virtual List&lt;ToppingVM&gt; Toppings { get; set; }
    public decimal TotalPrice { get; set; }
}
</code></pre>

<p>And this is the form which is contained inside a Partial View:</p>

<pre><code>@using (Html.BeginForm(null,null,FormMethod.Post, htmlAttributes: new { @id="frmCreatePV"}))
{
    @Html.AntiForgeryToken()
    &lt;div class="form-horizontal"&gt;
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        &lt;div class="form-group"&gt;
            @{
                for (int i = 0; i &lt; Model.Toppings.Count; i++)
                {
                    &lt;div class="col-xs-4"&gt;
                        @Html.HiddenFor(model =&gt; model.Toppings[i].SpecificTopping)                       
                        @Html.CheckBoxFor(model =&gt; model.Toppings[i].IsSelected, htmlAttributes: new { data_price = Model.Toppings[i].Price, @id = "chbkPrice" })                      
                        @Html.HiddenFor(model =&gt; model.Toppings[i].Price)
                         @Html.LabelFor(model =&gt; model.Toppings[i].IsSelected , Model.Toppings[i].SpecificTopping)                        
                        &lt;p&gt;Price: @Model.Toppings[i].Price&lt;/p&gt;
                    &lt;/div&gt;
                }
            }
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
            &lt;div class="col-md-10"&gt;
                &lt;input type="button" value="Add order" id="btnAddOrderPost" class="btn btn-primary"
                       data-url_add_order="@Url.Action("CreatePV", "Orders")" /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
                }
</code></pre>

<p><strong>UPDATE</strong></p>

<p>Finally this is how the Action Controller stayed:</p>

<pre><code>  [HttpPost]
    [ValidateAntiForgeryToken]
    public JsonResult CreatePV(OrderVM orderVM)
    {
        int id = Convert.ToInt32(TempData["License"]);
        if (ModelState.IsValid)
        {
            List&lt;string&gt; top = new List&lt;string&gt;();
            decimal tempPrice = 0M;
            for (int i = 0; i &lt; orderVM.Toppings.Count; i++)
            {
                if (orderVM.Toppings[i].IsSelected == true)
                {
                    top.Add(orderVM.Toppings[i].SpecificTopping);
                    tempPrice += orderVM.Toppings[i].Price;
                }
            }
            Order order = new Order
            {
                Customer = db.Customers.Where(c =&gt; c.LicenseNumber == id).First(),
                LicenseNumber = id,
                Toppings = top,
                TotalPrice = tempPrice
            };
            db.Orders.Add(order);
            db.SaveChanges();
            return Json(new { success= true, JsonRequestBehavior.AllowGet});
        }           
        return Json(new { success = false, JsonRequestBehavior.AllowGet});
    }
</code></pre>

<p>And the JQuery function, note that I made use of serializeArray() to add an element to the data that was not bound to the html form :</p>

<pre><code>function PostOrder()
{
    var orderVM = {};   
    id = $(".aslink").data("customerid");
    alert($("#btnGetOrderAdd").data("customerid"));
    var url = $("#btnAddOrderPost").data("url_add_order");
    var datavar = $("#frmCreatePV").serializeArray();
    datavar.push({name: "LicenseNumber" ,value : id})  
    $.ajax({
        type:"post",
        url: url,       
        data: datavar,
        datatype: "json",      
        success: function () {
            alert("it was inserted");
        }
    })
}
</code></pre>