Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
$Get.Json return 404 after publishing project to iis

Hi I am calling a get json to receive data and after I publish my project to IIS server the below request suddenly gives me an 404 error. Everything works fine in visual studio.

    public IActionResult GetDataAll()
    {
        using (PrognoseDbContext prognoseDbContext = new PrognoseDbContext())
        {

            var data1 = prognoseDbContext.CprPrognoseSamlet.ToList();
            return Json(data1);

        }                                  
    }

I can read from other posts that I shouldn't hardcode the URL because that can cause issues so I tried not to but it still does not work. So how can I fix the problem?

This is my javascript calling my controller:

$.getJSON( "@Url.Action("GetDataAll", "Home")", function (data1) 

This is the error I get:

Failed to load resource: the server responded with a status of 404 (Not Found) at Object. (highcharts.src.js:224) at B (highcharts.src.js:1668) at Object.r [as error] (highcharts.src.js:246) at highstock.src.js:21 at highstock.src.js:9

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!