Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
$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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda