My ASP.NET MVC project works flawlessly when debugging locally.
However, once it is deployed to production, the true "Path" of the application is http://servername/virtualpath/Home/Index
, just as an example.
There is some JavaScript that needs to declare the true baseUrl
regardless of the environment it is deployed to.
In summary, I need a JavaScript variable to hold http://servername/virtualpath/
when it is deployed to such an environment, or just http://servername/
when it is running on an environment such as in debug.