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

  • Home
  • SEARCH
  • 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 9001821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:29:14+00:00 2026-06-16T00:29:14+00:00

I serialize Fpr, and post it to the server using jquery. in the action

  • 0

I serialize Fpr, and post it to the server using jquery.
in the action method, I try go get a List<T> or IEnumerable<T> of the object but the List<T> or IEnumerable<T> is null.
How to post it to the method so i will get it as List or IEnumerable.

var div = $("#TableForm").serialize();
$.post("../Controller/Action?Mode=" + Mode, div , function () { });

I serialize the form and the serialize is OK. The problem is only in the action – that i got null, please help

  • 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-16T00:29:15+00:00Added an answer on June 16, 2026 at 12:29 am

    First of all, you can’t serialize a table object:

    HTML:

    ​<table id="myTable">
        <tr>
            <td><input id='one' name='one' value='blah' /></td>
            <td><input id='two' name='two' value='moreblah' /></td>
        </tr>
    </table>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
    

    JavaScript:

    var serialized = ​$("#myTable").serialize();
    debugger;​​​​​
    

    When the code pauses in the debugger, you can see that serialized is "", the empty string. MVC won’t know how to model bind this to your IEnumerable, so it is null.

    On the other hand, if you do this:

    var serialized = ​$("#one, #two").serialize();
    debugger;​​​​​
    

    Then serialized will be equal to "one=blah&two=moreblah".

    Second, if you’re actually binding to a form then all input elements inside the table will be correctly serialized. However, the names of your input elements are extremely important since you are trying to model-bind to an IEnumerable<CafePlaced>. Read this article by Phil Haack on model binding to a list: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

    If you don’t do it correctly, then MVC won’t know how to model bind and your parameter will come through as null.

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

Sidebar

Related Questions

i use jquery serialize but it returns empty string. <form id=form1 runat=server> <input name=kongreAd
How can I de-serialize a json object sent from javascript (using jquery.ajax) to a
I need to serialize an object to JSON . I'm using jQuery . Is
I am trying to serialize an object & save it into a Sql server
I try to serialize an instance of my ActiveRecord model to JSON (using render
I can serialize an object to a file using: var writeStream = File.Open(l.osl, FileMode.Create);
I'm trying to serialize a very large IEnumerable<MyObject> using an XmlSerializer without keeping all
I'm trying to serialize an object using servicestack in monotouch and I can't for
I'm trying to serialize a list of BasicNameValuePairs using type adapters and Gson ArrayList<BasicNameValuePair>
I serialize my c# object to xml, then got varchar such as '2009-05-09T13:50:59.6361485+08:00'. But

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.