سؤال

I have come across an issue that I have having trouble getting past. I have a view that is using the the following checkbox in a preview popup window:

@Html.CheckBoxFor(x => x.Payee)

In IE 10, this checkbox passes the value back to the code and works correctly. However, in IE 11 and Chrome this value is not being passed back. Has anyone encountered this before or have suggestions of an approach to resolve this issue?

Update:

In looking a little more I did notice the query strings between IE 10 (works) and Chrome(does not work) are different.

In IE 10 query string has:

Payee=true&Payee=false

In Chrome the query string has:

Payee%5b%5d=true&Payee%5b%5d=false

Is there a way to get it to pass the above query string? Or am I going in the wrong direction?

Thanks!

هل كانت مفيدة؟

المحلول

Found the solution to the issue. Needed to add the following code to the view and it runs great now! I am now looking into why IE 11 and Chrome try to pass along %5b%5d (brackets) along with the query string where as IE 10 does not.

    <script type="text/javascript">
        $(document).ready(function () {
           $.ajaxSettings.traditional = true;
        })
    </script>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top