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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:48:26+00:00 2026-05-26T17:48:26+00:00

The following JSON call always hits the AJAX error handler, and I can’t figure

  • 0

The following JSON call always hits the AJAX error handler, and I can’t figure out why:

$.ajax({
    type: "GET",
    url: '<%= Url.Action("MyTest", "Detail") %>',
    dataType: "json",
    error: function (xhr, status, error) {
        alert(xhr + " | " + status + " | " + error);
    },
    success: function (json) {
        alert(json);
    }
});

All I get is Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:4497/Detail/MyTest?_=1320681138394

When I set a breakpoint in the controller, I can see that it’s being reached, so I’m not sure where the request is falling down. Here’s the action in the DetailController:

Function MyTest() As JsonResult
    Return Json("Hello")
End Function

Any ideas?

  • 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-26T17:48:27+00:00Added an answer on May 26, 2026 at 5:48 pm

    The jQuery error handler is fired because it failed to parse the returned page as valid JSON. Since you get 500 internal server error, the page most likely doesn’t contain valid JSON.

    Load this page in your browser and fix it until it gives valid json:

    http://localhost:4497/Detail/MyTest
    

    After it is giving valid json in the browser, try the jQuery ajax call.

    I have no idea of even the basic functionality of VB.NET but can you make so that the only thing that is printed on http://localhost:4497/Detail/MyTest is like:

    print( '{"message":"hello"}' );
    

    If the only thing the page is outputting is {"message":"hello"} then json error handler will not fire

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

Sidebar

Related Questions

I'm using the following code to get some json formatted data: $.ajax({ type: GET,
I have the following working Ajax call - $.ajax({ url: ajaxUrl, type: sendHttpVerb, dataType:
I have the following restful api ajax call: $.ajax({ type: POST, url: https://website.com/a/login, data:
I have the following JSON structure, being returned from an AJAX call (pseudo values)
In my JS I have the following ajax call, that bind the resulting json
I have the following JSON returned from an AJAX call: {rows:[{Date:07/10/2011,Value:1206,Action:Drink}, {Date:07/11/2011,Value:2288,Action:Pie}, {Date:07/12/2011,Value:1070,Action:Drink}, {Date:07/13/2011,Value:1535,Action:Beer},
I'm trying to do something like the following: $.ajax({ url: /Track/Search, type: POST, data:
I have the following AJAX call: $('#FonykerUsernameRegister').blur(function(){ if($(this).val().length > 2) { alert($(this).val()); $.ajax({ url:
I make the following JQuery(v1.5.1) Ajax call: function testAjaxCall() { $.ajax( { url: /Search.ashx?,
If I have a ajax call: $.ajax({ url: url, dataType: 'json', data: data, success:

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.