Sending 2 arrays with ajax

Sending 2 arrays with ajax

 Hi, I'm trying to send two arrays to an asp.net mvc method using ajax. The two arrays come from the values of two lists of checkboxes. 

The problem I'm having is that I don't know how to send them both at the same time. 

Here is my code at the moment: 

  1. $("#sendAjaxButton").click(function() {

        var array1 = $(".checkBoxList1:checked").map(function() { return this.valueOf() });

        var array2 = $(".checkBoxList2:checked").map(function() { return this.valueOf() });

        var d = {first: array1, second:array2};

        $.ajax({

            type: "POST",

            data: d,

            success: function(html) {

                $("#list").replaceWith(html);

            },

            url: "/Itemlist/"

        });

    }); 

The asp function needs some way to differentiate the two arrays. 

Anyone know how to do this?