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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:15:20+00:00 2026-06-15T06:15:20+00:00

post methot: function PostChartValues(meter_id, range_type_id, start_date, end_date) { var values = $(#type_selection).val(); //values =

  • 0

post methot:

function PostChartValues(meter_id, range_type_id, start_date, end_date) {
var values = $("#type_selection").val();
//values = expected values as string array
$.ajax({
    url: '/Widget/GetMeterReadingsTimeSeries',
    type: 'POST',
    data: { MeterType: meter_id, DateRangeType: range_type_id, StartDate: start_date, EndDate: end_date, Parameters: values },
    beforeSend: function () {
        $("#chart_loading_div").show();
    },
    complete: function () {
        $("#chart_loading_div").fadeOut();
        $(".grids").jqGrid('GridUnload');
        grid(meter_id, range_type_id, $("#start_date").val(), $("#end_date").val());
    },
    success: function (result) {
        $("#chart").html(result);
    },
    error: function (result) {
        alert("Seçilen kritere uygun veri bulunamadı!");
    }
});   //end ajax
} //end PostChartValues

action method:

public ActionResult GetMeterReadingsTimeSeries(int MeterType, int DateRangeType, DateTime? StartDate, DateTime? EndDate,string[] Parameters)
{
    // ...
    return PartialView("_TimeSeries", chart);
}

I debugged it. only Parameters array is null. Is there an other way to post array with jquery post?

Thanks.

  • 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-15T06:15:21+00:00Added an answer on June 15, 2026 at 6:15 am

    You can post selected values as string then you parse it back to array. I have created basic sample below,

    Markup

    <script src="~/Scripts/jquery-1.7.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#someButton').click(function () {
                var selectedValues = [];
                $('#MyDiv input:checked').each(function () {
                    selectedValues.push($(this).val());
                });
                console.log(selectedValues);
                $.ajax({
                    url: 'someurl',
                    type: 'POST',
                    data: { values: selectedValues.join(",") }
                });
            });
        });
    </script>
    <button id="someButton">Do Ajax</button>
    <div id="MyDiv">
        <input type="checkbox" value="test1" />
        <input type="checkbox" value="test2" />
        <input type="checkbox" value="test3" />
    </div>
    

    Controller

    public class HomeController : Controller
        {       
           public void Test(string values)
            {
                string[] selectedValues = values.Split(',');
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can PHP array passed POST method to catch in ASP.NET MVC? Query string: WebAccess/ArrayTest?val[]=1&val[]=2&val[]=3
$.post('somescript.php', { data: $('#myInputField').val() }, function(replyData) { 1) Is the second argument of this
$.ajax({ method: post , url: save.php , data: id=453&action=test , beforeSend: function(){ } ,
I read some values from text boxes and send them via jQuerys post method
Here is the JQuery: $(document).ready(function() { $('#autosave').click(function() { var url = window.location.pathname; $postData =
Is it possible to use HTTP POST method with ImportHtml function? It seems to
I want to trigger this function, which uses the jquery's post method, when a
I am having a problem while calling overloaded C# function through jquery post method.
I would like to use the AntiForgeryToken function but the AcceptVerbs post does not
I'm trying to use jQuery's $.post() method with variables from values taken from textboxes

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.