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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:52:51+00:00 2026-06-17T20:52:51+00:00

Using ASP.NET MVC 3 , I’m making a jQuery ( ver 1.7.1 ) AJAX

  • 0

Using ASP.NET MVC 3, I’m making a jQuery (ver 1.7.1) AJAX call, like I’ve done a billion times. However, I’ve noted something strange. The following call works fine:

// license object
var license = {
    City: "New York",
    CompanyID: 1,
    County: "N/A",
    IsActive: true
};
// make the request
var $req = $.post('/License/theLicense', license); 
$req.success(function () {
    // this works!
});


[HttpPost]
public void Save(License theLicense)
{
    // save
}

However, when I specify the data parameter for the controller it doesn’t register at the controller

// license object
var license = {
    City: "New York",
    CompanyID: 1,
    County: "N/A",
    IsActive: true
};
// make the request
// this time the controller parameter is specified
// the object will be blank at the server
var $req = $.post('/License/theLicense', { theLicense: license });
$req.success(function () {
    // this does not work
});

The object is blank at the controller as shown below

enter image description here

This is annoying because I will need to pass another data parameter, but I can’t due to this issue.

NOTE: The JSON is identical to the POCO.

Why is it when I specify the data parameter the object shows up blank at the controller, but when I don’t it’s just fine?

  • 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-17T20:52:52+00:00Added an answer on June 17, 2026 at 8:52 pm

    Sometimes the POCO deserializer gets caught on for strange reason. I have seen it before where my JSON object exactly matches the POCO and it still won’t deserialize.

    When this happens I usually send the object to the server as a JSON string and then deserialize it on the server. I personally use ServiceStack.Text because it is the fastest.

    So your jQuery would go like this:

    var license = {
        City: "New York",
        CompanyID: 1,
        County: "N/A",
        IsActive: true
    };
    
    var $req = $.post('/License/theLicense', JSON.stringify(license));
    

    Then your Controller would take in a string parameter (json) to deserialize the object:

       [HttpPost]
       public void Save(string json)
       {
           License theLicense = JsonSerializer<License>.DeserializeJsonString(json);
           // save
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using asp.net MVC in c#, I am making a call to a stored procedure
Using ASP.NET MVC + jQuery : I need to use some values owned by
Using ASP.NET MVC 4, jQuery 1.6.2, jQuery UI 1.8.11. Currently debugging in Firefox 16.0.2.
I am using ASP.NET MVC project and jQuery to handle async requests. Sometimes for
I am using ASP.NET MVC and jQuery. I have this code in my js
Using ASP.NET MVC's default view engine, you can declare a server-side comment like this:
Have: Using ASP.NET MVC 2, DataAnnotationsModel based server validation, and client validation with jQuery.
Using ASP.NET MVC, Entity framework, jQuery. I want to give users the ability to
I am using asp.net mvc 3 jquery validate unobstructive javascript. I am trying to
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,

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.