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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:34:30+00:00 2026-06-15T21:34:30+00:00

I want to retrieve some data using $.ajax from the external ASP.NET MVC site

  • 0

I want to retrieve some data using $.ajax from the external ASP.NET MVC site (in this case – from my site). The code below geive me a 404 Not Found error (of course the url is valid.

But, if I change the url from url: 'http://myurl.com/Home/GetMyCode/?id=mycode' to url: 'http://localhost:123/Home/GetMyCode/?id=mycode' everything is fine. So, how to fix it ?

 $.ajax({
        url: 'http://myurl.com/Home/GetMyCode/?id=mycode',
        type: 'POST',
        contentType: "application/json; charset=utf-8",
        crossDomain: true,
        success: function (res) {
            ...
        },
        error: function (jqXHR, textStatus, errorThrown) {
            ...
        }
    });


    [HttpPost]
    public JsonResult GetMyCode(string id)
    {
        try 
        {
            return Json(new { result = "ok", resultData = "OK") });
        }
        catch (Exception e)
        {
            return Json(new { result = "error", resultData = "An error occured" });
        }            
    }
  • 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-15T21:34:32+00:00Added an answer on June 15, 2026 at 9:34 pm

    that tutorial worked for me, I had to implement the JSONP handling in my MVC project. http://www.codeguru.com/csharp/.net/net_asp/using-jsonp-in-asp.net-mvc.htm

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

Sidebar

Related Questions

I want to start several threads, retrive data from net, perform some actions with
I'm using ajax calls to retrieve some HTML data. In certain cases, there are
im trying to retrieve some data using a reader in vb.net. I dont have
I want to read/retrieve some details from a single YouTube video using: $sxml= simplexml_load_file(http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ);
I am trying to retrieve some data from an API using CURL request. Is
I have created a database and i want to retrieve some data from the
My app is calling a web service to retrieve some data, and I want
I am using mysql and facing some problem. I want to retrieve last row
I want to serialize some information I retrieve from the user in a small
I want retrieve the width and height of browser in pixel(px) using ruby code.

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.