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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:27:51+00:00 2026-05-16T03:27:51+00:00

I have a relatively simple example of an MVC page that is using jQuery

  • 0

I have a relatively simple example of an MVC page that is using jQuery to make a POST to get some JSON data and then just show a success/failure message when it is done. The code works perfectly fine in the other browsers but in IE7/8 it seems to fail 4/5 times.

Here is the MVC View Page:

<asp:Content runat="server" ContentPlaceHolderID="MainContent">
    <p id="message"></p>
</asp:Content>

<asp:Content runat="server" ContentPlaceHolderID="HeadContent">
   <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.1.min.js") %>"></script>

   <script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            type:"POST",
            url: "<%= Url.Action("GetData") %>",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(data){
                $("#message").html("success");
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                $("#message").html("error: " + textStatus + "<br/>exception:" + errorThrown);
            }
        });
    });
    </script>
</asp:Content>

The controller is pretty simple as well:

[HttpPost]
public ActionResult GetData()
{
    IList<string> people = new List<string>
    {
        "A",
        "B",
        "C",
        "D",
        "E"
    };

    return Json(people);
}

It seems to fail in IE 4 out of every 5 times roughly. I put some logging code in the controller and it calls the controller action every time, even when it fails. Does anyone see anything that I am doing wrong here?

When it hits my error handler function the textStatus is just set to “error” and errorThrown is undefined.

  • 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-16T03:27:51+00:00Added an answer on May 16, 2026 at 3:27 am

    Try with {} (or null) instead of "{}" as the data.

    As you’re sending JSON to the action (contentType is set to JSON), unless you have a JSON Value Provider Factory set up, this might be the cause of the problem.

    Take a look at Phil Haack’s article on Sending JSON to an ASP.NET MVC Action Method Argument if this is something you’re keen to do.

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

Sidebar

Related Questions

I have a relatively simple question. Will using PHP guarantee that a form is
I have a relatively simple HTML / JavaScript form. Such as this: <form method='POST'
I have a relatively simple object with a method that makes an HTTP request.
I have a relatively simple class which deletes a post: function delete_post($postid, $reason){ //Stuff
I have a relatively simple application which I need to make native Mac OSX
I have a relatively simple question that I cannot seem to find the answer
I have this relatively simple regex for usernames // Enforce that username has to
I have a relatively simple web app, that allows the user to enter two
I have converted a relatively simple algorithm that performs a large number of calculations
I have a relatively simple DSL that I would like to handle more robustly

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.