Additional directory name issue when ASP.NET MVC site is deployed to IIS

77
December 02, 2019, at 11:10 PM

I have created a ASP.Net MVC site. In the views I use JQuery data table to display records. Also, I use Ajax calls to get data to show in the web views. Also I have a image background set in the _Layouts.cshtml. This all worked fine in the developers machines. Accessed the site using http://localhost:portnumber format.

Now the site has been deployed to a UAT environment at clients end. It seems the devops guys have deployed it as a microsite/as a new directory in a existing site. The URL I get to see looks like http://companysitename/ANameGivenToMyApplication

Now The background image does not load. The Ajax calls to the controllers does not work, hence data does not get loaded to the JQuery data table view.

I tried to capture the "ANameGivenToMyApplication" part n the url, by using various way but no luck. The results are as below:

window.location.origin > http://companysitename 
window.location.host > companysitename 
window.location.hostname > companysitename 
window.location.pathname > ANameGivenToMyApplication/MyController/Index 
window.location.href > http://companysitename/ANameGivenToMyApplication/MyController/Index

Seems like if this "ANameGivenToMyApplication" part (which probably is a directory name) is not there in the URL anymore the issues go away.

How can I avoid this deployment issue (or rather way of deployment) affect the whole web application which I have developed?

--UPDATED--

The DevOps guys have added the site as a "Application" within a existing web site in IIS

READ ALSO
Check if xml is different, either whole xml or just <lastBuildDate>

Check if xml is different, either whole xml or just <lastBuildDate>

I'm trying to verify if a XML document got modified after I loaded my page, like maybe every 30 secondsI obtain the xml by making an AJAX request, and preferably, I want to compare the new one and the previous one before calling a function that displays...

81
select attribute of an element inside data-content of a popover

select attribute of an element inside data-content of a popover

I was using Bootstrap 4 popover and suddenly got stuck with this issueThe problem is I can not select the attribute inside data-content of a popover

89
Required property in form inputs not working when registering a click event on submit button

Required property in form inputs not working when registering a click event on submit button

I have a Django form and it has inputs with the required propertyI also have a DWobject inside the form which should have a scanned image before submitting the form

46
Run jQuery document ready function a second time onclick?

Run jQuery document ready function a second time onclick?

I am sorry, I know this might be a very basic questionI have a document ready jQuery function, that has various different functions inside itself

71