user1166305
user1166305

Reputation: 379

Deploying MVC 3 application to URL Folder has corrupted javascript and content path

I have created a mvc3 application which work fine locally. I work for a department where all websites sits under single url. when i deployed my website to test environment than page are coming up but all java script and content (images,css) folder path is not right.

I work for a department where all websites sits under single url eg https://abcd.test.hosts.network/application1 ,https://abcd.test.hosts.network/application2

When i check location of images it shows following path http://abcd.test.hosts.network/Content/Images/Master/masterBannerLeft5.jpg

What should i do or how i should deploy my application to fix the problem of java script and content folder.

Upvotes: 0

Views: 251

Answers (1)

Ian Routledge
Ian Routledge

Reputation: 4042

Are you using the following for referencing content files:

<link href="@Url.Content("~/content/css/normalize.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/content/js/jquery.js")"></script>

rather than:

<link href="/content/css/normalize.css" rel="stylesheet" type="text/css" />

See http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.content.aspx for the details, it basically resolves the path within your application.

Upvotes: 1

Related Questions