전방 Js 전송 수조를 서버에 전송

2509 단어 서버
 $("#delete").click(function () {

                var ID = "";

                var ary = [];

                var bb = document.getElementsByName("PersonId");

                $('input:checkbox[name="PersonId"]:checked').each(function () {

                    ary.push($(this).val());

                });

                if (ary.length == 0) {

                    alert(" ");

                }

                else {

                    $.ajax({

                        type: "POST",

                        url: "@Url.Content("~/User/BatchDelete")",

                        contentType: "application/json;charset=utf-8",

                        dataType: "json",

                        data: JSON.stringify(ary),

                        success: function (data) {

                            var i = 0;

                            $('input:checkbox[name="PersonId"]:checked').each(function () {

                                window.location.reload();

                            });

                        }

                    });

                }

            });

서버 쪽 (asp.net mvc controller)
       [HttpPost]

        public async Task<ActionResult> BatchDelete(string[] ary)

        {

            foreach (var id in ary)

            {



            }

            return Json(" ");

        }


좋은 웹페이지 즐겨찾기