ASP.Net MVC Error: the server responded with a status of 404 (Not Found)

on Jul 11, 2019 12:18 AM

Hello everyone,

I have an MVC5 application and when I run it in Localhost it runs great no errors!

When I publish it and deploy it on my server. (Windows Server 2016 and I tried AWS cloud) and put it on IIS I can get to my home page and my other links but when I run my ajax() and call an Action in my controller I get x.219/Parts/DoPartBookFunc?bookval=8 404 (Not Found)

when I run localhost on the server I get Failed to load resource: the server responded with a status of 404 (Not Found)

but when I debug the app locally it works. I been researching and trying a bunch of different things but so far no luck. Some I tried was @Url.action(“”,””), adding a ~ in front adding ../ in front making a global file and many other things.

If someone knows how to fix this it would be hugely appreciated.

$("#PartBook").on("change", function () {
    var selectV = $(this).val();
    var selectT = $(this).text();
        url: '/Parts/DoPartBookFunc',
        type: 'GET',
        dataType: 'json',
        data: { bookval: selectV },
        //contentType: 'application/json; charset=utf-8',
        success: function (data) {
        //alert("s" + data.PartNextNumber);


Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Jul 12, 2019 12:22 AM
bigbear says:
url: '/Parts/DoPartBookFunc',

Change with 

url: '~/Parts/DoPartBookFunc',

or use

@Url.Action("DoPartBookFunc", "Parts")