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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:13:16+00:00 2026-06-11T13:13:16+00:00

I have an ajax call that has been working fine on a hosted website

  • 0

I have an ajax call that has been working fine on a hosted website until recently

Defined like this

$.ajax({
        url: 'GetItemsForCountry',
        type: 'GET',
        data: "country=" + country,
        success: function (items) {
            $("#Items").empty();
            $("#Items").attr("disabled", false)
            $.each(items, function (i, c) {
                $("#Items").append($('<option></option>').val(c.Value).html(c.Text))
            }
                  );
        })

When I try and debug it locally in VS it’s working fine and I see it passing my controller on the line…

http://localhost:9000/Home/GetItemsForCountry?country=USA

when I run it with it on the hosted server, it is being passed as

http://servername/GetItemsForCountry?country=USA.  

It wasn’t doing this before.

Does anyone have a clue why? or know a way to MapRoute it to make this not give a 404 error?

Thanks for any help.

David

  • 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-11T13:13:18+00:00Added an answer on June 11, 2026 at 1:13 pm

    If you change the URL to /home/getitemsforcountry it will work on the server and locally. Just using Getitemsforcountry will attempt to tack that onto the current “area” of the site you are in.

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

Sidebar

Related Questions

I have some Ajax that has been working on a live site, now it
A situation I ran across this week: we have a jQuery Ajax call that
I have a web service that returns this string via the jQuery $.ajax() call
I have an ajax call that fires multiple times but is called once. function
I have a jQuery ajax call that returns html of a table. Now I
I have a jQuery AJAX call that I will need to do multiple times
I have an $.ajax call that includes both a success and error condition: $('input[name=StateName]').live('change',
I have some html returned from an ajax call that contains blocks of html.
I have a ajax call on my onkeyup event, that checks if the given
I have a php script that gets called via an ajax call. Values are

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.