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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:24:37+00:00 2026-05-23T17:24:37+00:00

Using MVC3 I am trying to accomplish the following. I have a table which

  • 0

Using MVC3 I am trying to accomplish the following. I have a table which has a number of values, using ajax I want to be able to select the remove checkbox (for any number of rows) which is part of the table.

The using ajax post the result to the controller for processing. The issue I currently have is I cannot get the controller to accept the data coming from the ajax post.

I am making use of jQuery and json to make the ajax call.

function removeRooms() {
    var jdata = { 'mRooms': [] };
    $('input:checked').each(function () {
        jdata['mRooms'].push($(this).val());        })

    $.ajax({
        url: "/room/removeselectedroom/@Model.mRoomid",
        type: "POST",
        dataType: "json",
        data: jdata,
        success: function (msg) {
            $('#mRooms').html(msg);
        }
    })
}

Any help you can give or resources would be appreciated.

EDIT:: One extra thing. I am getting through a IEnumerable object but there is a parameter an item in position one of the list with the value ‘on’ strange as there is only numbers in my checkboxes.

  • 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-05-23T17:24:37+00:00Added an answer on May 23, 2026 at 5:24 pm

    Try to serialize the data with traditional: true

    $.ajax({
        url: "/room/removeselectedroom/@Model.mRoomid",
        type: "POST",
        dataType: "json",
        data: jdata,
        traditional: true,
        success: function (msg) {
            $('#mRooms').html(msg);
        }
    })
    

    Here some information about array serialization.

    As of jQuery 1.4, the $.param() method serializes deep objects recursively to accommodate modern scripting languages and frameworks such as PHP and Ruby on Rails. You can disable this functionality globally by setting jQuery.ajaxSettings.traditional = true;.

    ASP.Net MVC model binding requires array data in form of

    mRooms=1&mRooms=2&mRooms=3
    

    But from jQuery 1.4 it sends

    mRooms[]=1&mRooms[]=2&mRooms[]=3
    

    This is why you have to use traditional: true

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

Sidebar

Related Questions

I'm using MVC3 with EF 4.1 and trying to edit a model which has
I am using MVC3, in which I have a page let say Home.cshtml with
I am using Asp.net MVC3 and trying to do a simple Ajax post to
Using MVC3, C#, and the Razor View Engine: I have a form that has
I am trying to select a multiple table from the database using LINQ in
I am using nhibernate and mvc3 in asp.net I'm trying to add data into
I am trying to teach my self MVC3 and EF4 using code first and
I am trying to get decimal value using LINQ in a MVC3 project. How
I am using MVC3, EF Model first. I have a form with two DropDownList
I'm using MVC3 and I have a model like this: public class Foo {

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.