I am working on an ASP.Net MVC 5 application that has lot of ajax calls using jquery post as well as Kendo UI DataSource. I have a problem previously with relative urls which are working when I run the project from VisualStudio under IIS Express where the URL does not have site name (ex. http://localhost:22332/ ) and It stopped working once I deployed this to test because of site name in the url (http://orgname.com/SiteName/).
I have resolved this by setting "base" in my _Layout.cshtml page like this.
<base href="~/" />
Everything was fine until I ran into issue with one ajax call on IE9.
My Ajax call is like this:
$.post("Controller/Method")
But in IE 9 it is being submitted to http://localhost:36380/Controller/New/Controller/Method
value of base is same in all the browsers which is "/" for localhost.
Is there a different behavior that I need to handle for IE9? This post is in a js file. If I can use ASP.Net MVC helper from a js file that can solve my problem too. Any suggestions?