I got a .NET MVC3 project that was just deployed to the actual server inside a virtual directory. Let me call him VirtDir . In my JavaScript files, all the URLs for AJAX are defined as follows:
"/Home/Save/"
which worked fine locally.
Actually this first "/" kills the virtual directory, so I get
"/Home/Save/" instead of "/VirtDir/Home/Save/" , which obviously fails.
If I delete the first "/", then the events break locally, as a result of which a specific URL is added to the URL of the current page: if you are on the "/Home/Index" page, the AJAX URL points to
"/Home/Index/Home/Save" .
My JavaScript is in separate * .js files, so I cannot write them @Url.Content .
Does anyone know of a good solution to this problem?
jquery ajax url-routing iis asp.net-mvc-3
Dimskiy
source share