Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9319925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:30:27+00:00 2026-06-19T03:30:27+00:00

Trying to do a post including some JSON data that has an array of

  • 0

Trying to do a post including some JSON data that has an array of integers in it. Pressing the button on my page to perform the post is getting to the action, but the expected data is not there (the two int[] variables are null). Doing a network profile while posting shows that the request body includes data like this:

groups%5B%5D=2&groups%5B%5D=3&alerts%5B%5D=5&alerts%5B%5D=9

Javascript:

$('#modal-save').click(function() { 
                var selectedGroups = [];
                var selectedAlerts = [];
                $('input:checked').filter('[data-group="true"]').each(function() {selectedGroups.push($(this).data('id')); });
                $('input:checked').filter('[data-group="false"]').each(function() {selectedAlerts.push($(this).data('id')); });
$.ajax({
                        type:'Post',
                        dataType: 'json',
                        url:'@Url.Action("UpdateAlertStores", new { alias = ViewBag.Alias})',
                        data: {groups: selectedGroups, alerts: selectedAlerts},
                    });

MVC Action:

[HttpPost]
public bool UpdateAlertStores(string alias, Guid? groupID, Guid? storeID, int[] groups, int[] alerts)
{
    return true;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:30:29+00:00Added an answer on June 19, 2026 at 3:30 am

    add traditional:true

    traditional: true,
    type:'Post',
    dataType: 'json',
    url:'@Url.Action("UpdateAlertStores", new { alias = ViewBag.Alias})',
    data: {groups: selectedGroups, alerts: selectedAlerts},
    

    after this changing your url looks like:

    groups=2&groups=3&alerts=5&alerts=9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to post JSON data to Spring controller.. Not working at all JSP Code:
Im trying to encode some html within json from PHP. The function requests data
I'm trying to POST a PayPal or GoogleCheckout buy now button from the code
I’ve been trying to post geolocation-targeted status updates on a Page through the Graph
I am trying to post an array of check box ids to an action
I am trying to create a dynamic web page which requires no post back
I'm trying to make a JSON call library. It has the following features. be
I recently played around with the ASP.NET WebAPI, including some Html-Pages displaying results, trying
I am in the middle of writing a page that does some reporting on
I'm trying to parse JSON data from a jquery form which is dynamically created.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.