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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:02:57+00:00 2026-06-11T17:02:57+00:00

I am intentionally trying NOT to use a binding in the controller parameter, so

  • 0

I am intentionally trying NOT to use a binding in the controller parameter, so I have a controller that looks like:

 [HttpPost]
        public ActionResult UntypedForm(String serializedformdata)
        {
        //// ...
        }

When I post serialized JSON form elements to the controller with the below code:

var formelements = $('#form').serializeArray();
$.post(url, formelements, function (data) {

    }, "json").error(function () {
        alert("Error posting to " + url); 
    });

I get a NULL value for String serializedformdata on my controller. However, when I replace String serializedformdata with a strongly-typed object, binding works properly as expected.

The whole point of my controller is generic JSON posts, where I will create a BSON document to place into a Mongo database. SO….I intentionally DO NOT want model binding and I want the serialized string as pamameter. Why is my serializedformdata string null when I post?

Note – I also tried to bind to Dictionary with

public ActionResult UntypedForm(Dictionary<string,string> serializedformdata)
            {
            //// ...
            }

but serializedformdata is still null.

  • 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-11T17:02:58+00:00Added an answer on June 11, 2026 at 5:02 pm

    The function serializeArray creates a Javascript object with the form’s key/value pairs. You don’t want that, you want a single key/value with serializedformdata = (JSON string). Ie, like this;

    var formelements = { serializedformdata: JSON.stringify($('#form').serializeArray()) };
    

    This passes the raw JSON string to the controller’s parameter. You can use the JavaScriptSerializer to get the object on the server:

    var obj = (List<Dictionary<string,string>>)new JavaScriptSerializer().Deserialize(serializedformdata, typeof(List<Dictionary<string,string>>));
    Dictionary<string,string> dict = obj.First();
    string someval = dict["somekey"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to demonstrate to our QA department that we have (or have not)
Possible Duplicate: Why does this intentionally incorrect use of strcpy not fail horribly? Below
So I know now that the debug assemblies have been intentionally left out of
I have a page with 2 web controls that intentionally have no knowledge of
(For the purposes of this question, let us assume that one is intentionally not
I have a VBA macro for Microsoft Word that I am trying to improve.
I have a php page that I'm trying to simplify and am running into
So I'm trying to make a Python app that's sort of like a set
My scenario: I have a shared hosting account running Apache that I use for
Ok, there's a keyword that I've intentionally kept away from the tags and the

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.