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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:25:44+00:00 2026-06-02T03:25:44+00:00

I have a controller method [HttpPost] public ActionResult GetUserData() { return Json(GetCurrentUser()); } I’m

  • 0

I have a controller method

[HttpPost]
public ActionResult GetUserData()
{
    return Json(GetCurrentUser());
}

I’m calling it $.ajax() through a method like this:

ServerCall: function (method, args, callback) {
        $.ajax({
            type: 'POST',
            url: method,
            data: JSON.stringify(args),
            contentType: 'application/json;charset=utf8',
            dataType: 'json',
            success: function (result) {
                if (callback) {
                    callback(result);
                }
            },
            error: function (err) {
            }
        });
    }

with the call being:

ServerCall('GetUserData', null, function(data){
});

As it is, when I make this call, $.ajax returns with success, but ‘data’ is null. Debugging, responseText is empty. On the server side, GetUserData is called, and it is returning a properly formatted Json object (I’ve gone so far as to create my own JSON ActionResult and verified that data is indeed being written to the response stream.

If I add a dummy parameter to the server side method:

[HttpPost]
public ActionResult GetUserData(string temp)
{
    return Json(GetCurrentUser));
}

everything works perfectly. Browser is IE8. My question is, can anyone explain why this is happening?

UPDATE:

Note workaround solution below: I’d still be interested in knowing the root cause.

  • 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-02T03:25:46+00:00Added an answer on June 2, 2026 at 3:25 am

    I was able to reproduce using Darin’s code in IE8. While I don’t know the root cause, I think it has something to do with how IE8 JSON.stringify handles null. Changing

    data: JSON.stringify(args)
    

    to

    data: args ? JSON.stringify(args) : null
    

    fixed the problem.

    Note, the problem is intermittent – I was seeing failures in about one out of every ten calls. With the change, over 100 tests, the failure rate was zero.

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

Sidebar

Related Questions

I have an MVC controller that has this Action Method: [HttpPost] public ActionResult SubmitAction()
I have a controller, and a method as defined... [HttpPost] public ActionResult UpdateUser(UserInformation model){
I have a controller method that returns a jSON object and in one calling
I have a controller method with the following signature: [AcceptVerbs(HttpVerbs.Post)] public ActionResult UpdateValues(int id,
I have a fairly standard .Net MVC Controller method: public ActionResult Add(Customer cust) {
I am using the default route. I have setup a method: [HttpPost] public ActionResult
I have a controller method that is a little something like this: def suggestions
i have this controller: public ActionResult Novo() { var products = context.Product.Select(x => new
In ASP.NET MVC I have a controller that looks somehow like this: public class
I have a controller with an action Review like so: [HttpPost, HttpGet] [RoleRequired(Payroll Tech)]

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.