I have a MVC Web Application with some Web APIs. In the Views I have implemented the Ajax Call to this Web APIs my problem is when I publish my application in a Subdirectory:
$.ajax({
url: "/api/ControllerName/Action",
});
I have read that when I use / at the beginning of the url it suppose that JQuery will append the base url of my webapplication that is http://localhost/Subdirectory so the full path of the Ajax call should behttp://localhost/Subdirectory/api/ControllerName/Action the problem is that instead of this JQuery is making the Ajax call with this Urlhttp://localhost/api/ControllerName/Action without the Subdirectory.
Any idea why the sub-directory is being ignored in the base url?
Thanks in advance,
Luis A.