Модель MVC, связывающая массив строк из поста jQuery

Параметр string[] orderTypeNamesприближается к нулю.

действие mvc

public PartialViewResult EditMultipleOrderStates(
    string[] orderTypeNames,
    int[] orderIds)

JavaScript

$('#edit-mulitple-order-states-button').click(function () {
    ids = [];
    types = [];
    $checked = $('.order-queue-order input:checked');
    $orders = $checked.closest('.order-queue-order');
    $orders.each(function (index, elem) {
        $order = $(elem);
        ids.push($order.attr("orderId"));
        types.push($order.attr("orderType"));
    });
    data = {
        orderIds: ids,
        orderTypeNames: types
    };
    $.post('EditMultipleOrderStates', data, function (response) {
        //...
    });
});

скрипач

enter image description here

orderIds%5B%5D=97&orderIds%5B%5D=98&orderIds%5B%5D=93&orderTypeNames%5B%5D=DeliveryOrder&orderTypeNames%5B%5D=DeliveryOrder&orderTypeNames%5B%5D=DeliveryOrder

Проблема в квадратных скобках? Как я могу привязаться к этим массивам?

Изменить:Тем временем я вручную строю строку запроса.

query = "";
for each...
query += "orderIds=" + $order.attr("orderId") + "&";
query += "orderTypeNames=" + $order.attr("orderType") + "&";
6
задан Benjamin 20 July 2012 в 18:16
поделиться