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 9283115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:32:52+00:00 2026-06-18T18:32:52+00:00

Here is a acript that I created to generate an array: var data_points =

  • 0

Here is a acript that I created to generate an array:

var data_points = $("#bcc_datapoint_selection").find("input:checked").map(function () {
    return $(this).val();
}).get();

Console log output:

["3","4","6"]

Ajax post script:

$.ajax({
    url: '@Url.Action("BccGetMeterReadingsChart", "Widget")',
    type: 'POST',
    data: { dataPoints: data_points },
    success: function (result) {
        $("#bcc_chart").html(result);
    },
    error: function () {
         alert("Seçilen kritere uygun veri bulunamadı!");
    }
}); //end ajax

Controller method:

public ActionResult BccGetMeterReadingsChart(string[] dataPoints)
{
    // Some code
    return Json("", JsonRequestBehavior.AllowGet);
}

Debug output:

dataPoints : null

Request data output:

dataPoints%5b%5d=3&dataPoints%5b%5d=4&dataPoints%5b%5d=6

What am I missing? Is it a problem in an Ajax function? Or another problem?

  • 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-18T18:32:54+00:00Added an answer on June 18, 2026 at 6:32 pm

    Try setting the traditional parameter to true for your AJAX request:

    $.ajax({
        url: '@Url.Action("BccGetMeterReadingsChart", "Widget")',
        type: 'POST',
        data: { dataPoints: data_points },
        traditional: true,
        success: function (result) {
            $("#bcc_chart").html(result);
        },
        error: function () {
             alert("Seçilen kritere uygun veri bulunamadı!");
        }
    });
    

    Now the POST payload will look like this:

    dataPoints=3&dataPoints=4&dataPoints=6
    

    And the model binder will happily bind the collection of points to your action argument.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here are two ways of setting context: $.proxy(function() { this.doStuff(); }, this); ... var
Here is another spoj problem that asks how to find the number of distinct
Here is the code in a function I'm trying to revise. This example works
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here's my code to find the prime factors of a number : #include <iostream>
Here is my code <?php function random_id() { $chars = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $id = '';
Here is a bitmap, which has a strange header. How was it created? What
Here's the setup - I have a view that lists products. On that same
Here is a scenario: User installs .NET application that you have made. After some

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.